Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Support json_array and simple_array Doctrine DBAL types
Browse files Browse the repository at this point in the history
  • Loading branch information
teohhanhui committed Aug 21, 2015
1 parent c4d3551 commit d15f909
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Knp/FriendlyContexts/Doctrine/EntityHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace Knp\FriendlyContexts\Doctrine;

use Doctrine\ORM\Mapping\ClassMetadata;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Doctrine\Common\Collections\ArrayCollection;
use Knp\FriendlyContexts\Utils\TextFormater;
use Knp\FriendlyContexts\Guesser\GuesserManager;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\DBAL\Types\Type as DBALType;
use Doctrine\ORM\Mapping\ClassMetadata;
use Knp\FriendlyContexts\Guesser\GuesserManager;
use Knp\FriendlyContexts\Utils\TextFormater;
use Knp\FriendlyContexts\Utils\UniqueCache;
use Symfony\Component\PropertyAccess\PropertyAccess;

class EntityHydrator
{
Expand Down Expand Up @@ -113,7 +114,7 @@ protected function formatFromMapping($mapping, &$property, &$value)
{
$property = $mapping['fieldName'];
$collectionRelation = in_array($mapping['type'], [ClassMetadata::ONE_TO_MANY, ClassMetadata::MANY_TO_MANY]);
$arrayRelation = $mapping['type'] === 'array';
$arrayRelation = in_array($mapping['type'], [DBALType::TARRAY, DBALType::SIMPLE_ARRAY, DBALType::JSON_ARRAY]);

if ($collectionRelation || $arrayRelation) {
$result = array_map(
Expand Down

0 comments on commit d15f909

Please sign in to comment.