#204·DeepCopy

Doctrine Proxy not working ?

Author: barbuslexCreated May 16, 2025Updated May 19, 2025

Hi,

I have a problem with Doctrine Proxy Matcher/Filter.

I have this code (from documentation) :

php
$duplicate = new DeepCopy(true);
$duplicate->addFilter(new ChainableFilter(new DoctrineProxyFilter()), new DoctrineProxyMatcher());
$duplicate->addFilter(new SetNullFilter(), new PropertyNameMatcher('id'));

$object = $demande->getResponsable();
$copy = $duplicate->copy($object);
dd($copy, $object);

Here the result : Image

The id is not set to null...

Have you an idea ?

Thanks