I am currently retrieving the class name of my entities to save changes into a log. This happens in a listener:
In my service layer:
$product = $line->getProduct();
$product->setAvailability($product->getAvailability() - $line->getAmount());
$em->persist($product);
the problem is that by doing following in a listener:
$className = join('', array_slice(explode('\\', get_class($entity)), -1));
$modification->setEntidad($className);
The $className
that is set into the modification is miomioBundleEntityProductoProxy
.
How can I get the real class name for my entity, and not the proxy class name?