JsonCodec
Interfaces to serialize and deserialize PHP objects to/from JSON
|
Classes implementing this interface support round-trip JSON serialization/deserialization via a JsonClassCodec object (which may maintain state and/or consult service objects). More...
Static Public Member Functions | |
static | jsonClassCodec (JsonCodecInterface $codec, ContainerInterface $serviceContainer) |
Create a JsonClassCodec which can serialize/deserialize instances of this class. | |
Classes implementing this interface support round-trip JSON serialization/deserialization via a JsonClassCodec object (which may maintain state and/or consult service objects).
It requires a single static method to be defined which allows the creation of an appropriate JsonClassCodec for this class.
|
static |
Create a JsonClassCodec which can serialize/deserialize instances of this class.
JsonCodecInterface | $codec | A codec which can be used to handle certain cases of implicit typing in the generated JSON; see JsonCodecInterface for details. It should not be necessary for most class codecs to use this, as recursive serialization/deserialization is handled by default. |
ContainerInterface | $serviceContainer | A service container |