4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\VarDumper\Caster;
14 use Doctrine\Common\Proxy\Proxy as CommonProxy;
15 use Doctrine\ORM\PersistentCollection;
16 use Doctrine\ORM\Proxy\Proxy as OrmProxy;
17 use Symfony\Component\VarDumper\Cloner\Stub;
20 * Casts Doctrine related classes to array representation.
22 * @author Nicolas Grekas <p@tchwork.com>
26 public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested)
28 foreach (array('__cloner__', '__initializer__') as $k) {
29 if (array_key_exists($k, $a)) {
38 public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested)
40 foreach (array('_entityPersister', '_identifier') as $k) {
41 if (array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) {
50 public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested)
52 foreach (array('snapshot', 'association', 'typeClass') as $k) {
53 if (array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) {
54 $a[$k] = new CutStub($a[$k]);