PHP Класс Atrauzzi\LaravelDoctrine\Type\Json

Doctrine has a json_array type but, as its name suggests, it was designed with only arrays in mind. This extending type fixes a bug with the json_array type wherein a null value in database gets converted to an empty array. IMPORTANT NOTE: you must register custom types with Doctrine: \Doctrine\DBAL\Types\Type::addType('json', '\Path\To\Custom\Type\Json'); Note from atrauzzi: I'm including this as a convenience for anyone using my package.
Наследование: extends Doctrine\DBAL\Types\JsonArrayType
Показать файл Открыть проект

Открытые методы

Метод Описание
convertToPHPValue ( $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform ) When database value is null, we return null instead of empty array like our parent does.
getName ( )
getSQLDeclaration ( array $fieldDeclaration, Doctrine\DBAL\Platforms\AbstractPlatform $platform ) Made to be compatible with Doctrine 2.4 and 2.5; 2.5 added getJsonTypeDeclarationSQL().

Описание методов

convertToPHPValue() публичный метод

public convertToPHPValue ( $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform )
$platform Doctrine\DBAL\Platforms\AbstractPlatform

getName() публичный метод

public getName ( )

getSQLDeclaration() публичный метод

public getSQLDeclaration ( array $fieldDeclaration, Doctrine\DBAL\Platforms\AbstractPlatform $platform )
$fieldDeclaration array
$platform Doctrine\DBAL\Platforms\AbstractPlatform