JsonArrayType
class JsonArrayType extends JsonArrayType (View source)
Extends the default doctrine JsonArrayType to work with entities.
TODO: If doctrine supports a Postgres 9.4 platform we could default to jsonb.
Constants
FLOW_JSON_ARRAY |
|
Properties
protected PersistenceManagerInterface | $persistenceManager | ||
protected ReflectionService | $reflectionService |
Methods
Gets the name of this type.
Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements.
Use jsonb for PostgreSQL, this means we require PostgreSQL 9.4
We map jsonb fields to our datatype by default. Doctrine doesn't use jsonb at all.
Converts a value from its database representation to its PHP representation of this type.
Converts a value from its PHP representation to its database representation of this type.
Fetches dependencies from the static object manager.
Traverses the $array and replaces known persisted objects (tuples of type and identifier) with actual instances.
Traverses the $array and replaces known persisted objects with a tuple of type and identifier.
We require a comment on the column to make doctrine recognize the type on already existing columns
Details
string
getName()
Gets the name of this type.
int
getBindingType()
Gets the (preferred) binding type for values of this type that can be used when binding parameters to prepared statements.
string
getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
Use jsonb for PostgreSQL, this means we require PostgreSQL 9.4
array
getMappedDatabaseTypes(AbstractPlatform $platform)
We map jsonb fields to our datatype by default. Doctrine doesn't use jsonb at all.
array
convertToPHPValue(mixed $value, AbstractPlatform $platform)
Converts a value from its database representation to its PHP representation of this type.
mixed
convertToDatabaseValue(mixed $array, AbstractPlatform $platform)
Converts a value from its PHP representation to its database representation of this type.
protected void
initializeDependencies()
Fetches dependencies from the static object manager.
Injection cannot be used, since __construct on Types\Type is final.
protected void
decodeObjectReferences(array $array)
Traverses the $array and replaces known persisted objects (tuples of type and identifier) with actual instances.
protected void
encodeObjectReferences(array $array)
Traverses the $array and replaces known persisted objects with a tuple of type and identifier.
bool
requiresSQLCommentHint(AbstractPlatform $platform)
We require a comment on the column to make doctrine recognize the type on already existing columns