Skip to content

Commit

Permalink
Deprecate old JsonArrayType
Browse files Browse the repository at this point in the history
  • Loading branch information
Taluu committed Jan 25, 2016
1 parent 7604e36 commit dee0141
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
4 changes: 4 additions & 0 deletions docs/en/reference/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 2 additions & 21 deletions lib/Doctrine/DBAL/Types/JsonArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,11 @@
* 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}
*/
Expand Down

0 comments on commit dee0141

Please sign in to comment.