for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Eccube\Doctrine\EventSubscriber;
use Doctrine\Common\EventSubscriber;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Doctrine\ORM\Events;
use Eccube\Application;
use Eccube\Entity\AbstractEntity;
class LoadEventSubscriber implements EventSubscriber
{
/**
* @var Application
*/
private $app;
* @param Application $app
public function __construct(Application $app)
$this->app = $app;
}
public function getSubscribedEvents()
return [Events::postLoad];
public function postLoad(LifecycleEventArgs $args)
$entity = $args->getObject();
if ($entity instanceof AbstractEntity) {
$entity->setAnnotationReader($this->app['eccube.di.annotation_reader']);