UidNormalizer
in package
implements
NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface
FinalYes
Table of Contents
Interfaces
- NormalizerInterface
- DenormalizerInterface
- CacheableSupportsMethodInterface
- Marker interface for normalizers and denormalizers that use only the type and the format in their supports*() methods.
Constants
- NORMALIZATION_FORMAT_BASE32 = 'base32'
- NORMALIZATION_FORMAT_BASE58 = 'base58'
- NORMALIZATION_FORMAT_CANONICAL = 'canonical'
- NORMALIZATION_FORMAT_KEY = 'uid_normalization_format'
- NORMALIZATION_FORMAT_RFC4122 = 'rfc4122'
Properties
- $defaultContext : mixed
Methods
- __construct() : mixed
- denormalize() : mixed
- Denormalizes data back into an object of the given class.
- hasCacheableSupportsMethod() : bool
- normalize() : array<string|int, mixed>|string|int|float|bool|ArrayObject|null
- Normalizes an object into a set of arrays/scalars.
- supportsDenormalization() : bool
- Checks whether the given class is supported for denormalization by this normalizer.
- supportsNormalization() : bool
- Checks whether the given class is supported for normalization by this normalizer.
Constants
NORMALIZATION_FORMAT_BASE32
public
mixed
NORMALIZATION_FORMAT_BASE32
= 'base32'
NORMALIZATION_FORMAT_BASE58
public
mixed
NORMALIZATION_FORMAT_BASE58
= 'base58'
NORMALIZATION_FORMAT_CANONICAL
public
mixed
NORMALIZATION_FORMAT_CANONICAL
= 'canonical'
NORMALIZATION_FORMAT_KEY
public
mixed
NORMALIZATION_FORMAT_KEY
= 'uid_normalization_format'
NORMALIZATION_FORMAT_RFC4122
public
mixed
NORMALIZATION_FORMAT_RFC4122
= 'rfc4122'
Properties
$defaultContext
private
mixed
$defaultContext
= [self::NORMALIZATION_FORMAT_KEY => self::NORMALIZATION_FORMAT_CANONICAL]
Methods
__construct()
public
__construct([array<string|int, mixed> $defaultContext = [] ]) : mixed
Parameters
- $defaultContext : array<string|int, mixed> = []
denormalize()
Denormalizes data back into an object of the given class.
public
denormalize(mixed $data, string $type[, string $format = null ][, array<string|int, mixed> $context = [] ]) : mixed
Parameters
- $data : mixed
-
Data to restore
- $type : string
-
The expected class to instantiate
- $format : string = null
-
Format the given data was extracted from
- $context : array<string|int, mixed> = []
-
Options available to the denormalizer
hasCacheableSupportsMethod()
public
hasCacheableSupportsMethod() : bool
Return values
boolnormalize()
Normalizes an object into a set of arrays/scalars.
public
normalize(AbstractUid $object[, string $format = null ][, array<string|int, mixed> $context = [] ]) : array<string|int, mixed>|string|int|float|bool|ArrayObject|null
Parameters
- $object : AbstractUid
- $format : string = null
-
Format the normalization result will be encoded as
- $context : array<string|int, mixed> = []
-
Context options for the normalizer
Return values
array<string|int, mixed>|string|int|float|bool|ArrayObject|null —\ArrayObject is used to make sure an empty object is encoded as an object not an array
supportsDenormalization()
Checks whether the given class is supported for denormalization by this normalizer.
public
supportsDenormalization(mixed $data, string $type[, string $format = null ]) : bool
Parameters
- $data : mixed
-
Data to denormalize from
- $type : string
-
The class to which the data should be denormalized
- $format : string = null
-
The format being deserialized from
Return values
boolsupportsNormalization()
Checks whether the given class is supported for normalization by this normalizer.
public
supportsNormalization(mixed $data[, string $format = null ]) : bool
Parameters
- $data : mixed
-
Data to normalize
- $format : string = null
-
The format being (de-)serialized from or into