CreationExtensions
class CreationExtensions implements Transient
The casts, normalizers and automatic lazy attributes resolved for one creation operation.
Everything an operation creates shares one instance, including nested values and deferred lazy collection items, so each extension is resolved once and the same instance handles every matching value.
Properties
| protected Cast> | $attributeCasts | ||
| protected Cast> | $casts | ||
| protected Normalizer>> | $classNormalizers | ||
| protected Normalizer> | $normalizers | ||
| protected AutoLazy> | $autoLazies | ||
| protected CastableCast> | $castableCasts | ||
| protected DateTimeInterfaceCast> | $dateCasts | ||
| protected EnumCast> | $enumCasts | ||
| protected BuiltinTypeCast> | $builtinCasts |
Methods
Create the extensions for one creation operation.
Get the ordered custom casts applicable to a property.
Get the factory and configured casts for one plain iterable type's items.
Get the custom normalizers for one data class.
Get the cast for a Castable class.
Get the built-in cast for a date type.
Get the built-in cast for a scalar or array type.
Details
at line 61
__construct(Container $container, DataConfig $config)
Create the extensions for one creation operation.
at line 72
array
propertyCasts(DataProperty $property, CreationContext $context)
Get the ordered custom casts applicable to a property.
at line 106
array
itemCasts(DataProperty $property, NamedType $type, CreationContext $context)
Get the factory and configured casts for one plain iterable type's items.
at line 128
array
normalizers(DataClass $dataClass, CreationContext $context)
Get the custom normalizers for one data class.
at line 166
AutoLazy
autoLazy(DataProperty $property)
Get the automatic lazy attribute instance for a property.
at line 179
CastableCast
castableCast(string $class)
Get the cast for a Castable class.
at line 187
DateTimeInterfaceCast
dateCast(string $type)
Get the built-in cast for a date type.
at line 195
EnumCast
enumCast(string $type)
Get the built-in cast for a backed enum type.
at line 203
BuiltinTypeCast
builtinCast(string $type)
Get the built-in cast for a scalar or array type.