Denormalizer
in package
FinalYes
Table of Contents
Properties
- $afterMappingCalls : array<string|int, ReflectionMethod>
- $class : ReflectionClass
- $convertEmptyStringToNull : bool
- $mapRecord : MapRecord|null
- $properties : array<string|int, ReflectionProperty>
- $propertySetters : array<string|int, PropertySetter>
Methods
- __construct() : mixed
- aliases() : array<string, string>
- allowEmptyStringAsNull() : void
- assign() : object
- assignAll() : Iterator
- denormalize() : object
- denormalizeAll() : Iterator
- disallowEmptyStringAsNull() : void
- registerAlias() : void
- Register a callback to convert a field into a specific type.
- registerType() : void
- Register a global type conversion callback to convert a field into a specific type.
- resolveTypeCaster() : string|null
- supportsAlias() : bool
- types() : array<string|int, string>
- unregisterAlias() : bool
- unregisterAll() : void
- unregisterAllAliases() : void
- unregisterAllTypes() : void
- unregisterType() : bool
- Unregister a global type conversion callback to convert a field into a specific type.
- autoDiscoverPropertySetter() : PropertySetter|null
- findPropertySetter() : PropertySetter|null
- getMethodFirstArgument() : ReflectionParameter
- getTypeCasting() : TypeCasting
- resolveTypeCasting() : TypeCasting
- setAfterMappingCalls() : array<string|int, ReflectionMethod>
- setClass() : ReflectionClass
- setPropertySetters() : array<string|int, PropertySetter>
Properties
$afterMappingCalls read-only
private
array<string|int, ReflectionMethod>
$afterMappingCalls
$class read-only
private
ReflectionClass
$class
$convertEmptyStringToNull
private
static bool
$convertEmptyStringToNull
= true
$mapRecord read-only
private
MapRecord|null
$mapRecord
$properties read-only
private
array<string|int, ReflectionProperty>
$properties
$propertySetters read-only
private
array<string|int, PropertySetter>
$propertySetters
Methods
__construct()
public
__construct(class-string $className[, array<string|int, string> $propertyNames = [] ]) : mixed
Parameters
- $className : class-string
- $propertyNames : array<string|int, string> = []
Tags
aliases()
public
static aliases() : array<string, string>
Return values
array<string, string>allowEmptyStringAsNull()
public
static allowEmptyStringAsNull() : void
since version 9.17.0
use League\Csv\Serializer\MapRecord::$convertEmptyStringToNull or League\Csv\Serializer\MapCell::$convertEmptyStringToNullinstead
Tags
assign()
public
static assign(class-string $className, array<string|int, mixed> $record) : object
Parameters
- $className : class-string
- $record : array<string|int, mixed>
Tags
Return values
objectassignAll()
public
static assignAll(class-string $className, iterable<string|int, mixed> $records[, array<string|int, string> $propertyNames = [] ]) : Iterator
Parameters
- $className : class-string
- $records : iterable<string|int, mixed>
- $propertyNames : array<string|int, string> = []
Tags
Return values
Iteratordenormalize()
public
denormalize(array<string|int, mixed> $record) : object
Parameters
- $record : array<string|int, mixed>
Tags
Return values
objectdenormalizeAll()
public
denormalizeAll(iterable<string|int, mixed> $records) : Iterator
Parameters
- $records : iterable<string|int, mixed>
Return values
IteratordisallowEmptyStringAsNull()
public
static disallowEmptyStringAsNull() : void
since version 9.17.0
use League\Csv\Serializer\MapRecord::$convertEmptyStringToNull or League\Csv\Serializer\MapCell::$convertEmptyStringToNullinstead
Tags
registerAlias()
Register a callback to convert a field into a specific type.
public
static registerAlias(string $alias, string $type, Closure $callback) : void
Parameters
- $alias : string
- $type : string
- $callback : Closure
Tags
registerType()
Register a global type conversion callback to convert a field into a specific type.
public
static registerType(string $type, Closure $callback) : void
Parameters
- $type : string
- $callback : Closure
Tags
resolveTypeCaster()
public
resolveTypeCaster(MapCell $mapCell, ReflectionMethod|ReflectionProperty $accessor) : string|null
Parameters
- $mapCell : MapCell
- $accessor : ReflectionMethod|ReflectionProperty
Return values
string|nullsupportsAlias()
public
static supportsAlias(string $alias) : bool
Parameters
- $alias : string
Return values
booltypes()
public
static types() : array<string|int, string>
Return values
array<string|int, string>unregisterAlias()
public
static unregisterAlias(string $alias) : bool
Parameters
- $alias : string
Return values
boolunregisterAll()
public
static unregisterAll() : void
unregisterAllAliases()
public
static unregisterAllAliases() : void
unregisterAllTypes()
public
static unregisterAllTypes() : void
unregisterType()
Unregister a global type conversion callback to convert a field into a specific type.
public
static unregisterType(string $type) : bool
Parameters
- $type : string
Return values
boolautoDiscoverPropertySetter()
private
autoDiscoverPropertySetter(ReflectionMethod|ReflectionProperty $accessor, array<string|int, string> $propertyNames, array<string|int, string|null> $methodNames) : PropertySetter|null
Parameters
- $accessor : ReflectionMethod|ReflectionProperty
- $propertyNames : array<string|int, string>
- $methodNames : array<string|int, string|null>
Tags
Return values
PropertySetter|nullfindPropertySetter()
private
findPropertySetter(MapCell $mapCell, ReflectionMethod|ReflectionProperty $accessor, array<string|int, string> $propertyNames) : PropertySetter|null
Parameters
- $mapCell : MapCell
- $accessor : ReflectionMethod|ReflectionProperty
- $propertyNames : array<string|int, string>
Tags
Return values
PropertySetter|nullgetMethodFirstArgument()
private
getMethodFirstArgument(ReflectionMethod $reflectionMethod) : ReflectionParameter
Parameters
- $reflectionMethod : ReflectionMethod
Tags
Return values
ReflectionParametergetTypeCasting()
private
getTypeCasting(string $typeCaster, ReflectionProperty|ReflectionParameter $reflectionProperty, array<string|int, mixed> $options) : TypeCasting
Parameters
- $typeCaster : string
- $reflectionProperty : ReflectionProperty|ReflectionParameter
- $options : array<string|int, mixed>
Tags
Return values
TypeCastingresolveTypeCasting()
private
resolveTypeCasting(ReflectionProperty|ReflectionParameter $reflectionProperty[, array<string|int, mixed> $options = [] ]) : TypeCasting
Parameters
- $reflectionProperty : ReflectionProperty|ReflectionParameter
- $options : array<string|int, mixed> = []
Tags
Return values
TypeCastingsetAfterMappingCalls()
private
setAfterMappingCalls() : array<string|int, ReflectionMethod>
Return values
array<string|int, ReflectionMethod>setClass()
private
setClass(class-string $className) : ReflectionClass
Parameters
- $className : class-string
Tags
Return values
ReflectionClasssetPropertySetters()
private
setPropertySetters(array<string|int, string> $propertyNames) : array<string|int, PropertySetter>
Parameters
- $propertyNames : array<string|int, string>