Commit dee01418 authored by Baptiste Clavié's avatar Baptiste Clavié

Deprecate old JsonArrayType

parent 7604e367
......@@ -390,6 +390,10 @@ Values retrieved from the database are always converted to PHP's ``array`` or
json_array
^^^^^^^^^^
.. warning::
This type is deprecated since 2.6, you should use ``json`` instead.
Maps and converts array data based on PHP's JSON encoding functions.
If you know that the data to be stored always is in a valid UTF-8
encoded JSON format string, you should consider using this type.
......
......@@ -25,30 +25,11 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
* Array Type which can be used to generate json arrays.
*
* @since 2.3
* @deprecated Use JsonType instead
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class JsonArrayType extends Type
class JsonArrayType extends JsonType
{
/**
* {@inheritdoc}
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return $platform->getJsonTypeDeclarationSQL($fieldDeclaration);
}
/**
* {@inheritdoc}
*/
public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if (null === $value) {
return null;
}
return json_encode($value);
}
/**
* {@inheritdoc}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment