services.xml의 파일을 작동하지 않는 교리 리스너를 등록 :심포니 2
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="task.task_history_insertion" class="Acme\Bundle\EventListener\TaskHistoryInsertion">
<argument type="service" id="service_container" />
<tag name="doctrine.event_listener" event="postPersist" method="postPersist"/>
</service>
</services>
</container>
TaskHistoryInsertion.php
postPersist가 지속 후에 호출되지 않는 이유에 어떤 아이디어class TaskHistoryInsertion implements EventSubscriber
{
protected $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function getSubscribedEvents()
{
return array(
Event::postPersist
);
}
public function postPersist(LifecycleEventArgs $args)
{
//not being called
}
}
?
에 대해 훨씬 더 명확한 그림을 제공 할 수있는 링크가 있습니다 : 어떤 가입자는 또한 유효 청취자입니다 - https://github.com/doctrine/common/blob/2.3.0 참조 /lib/Doctrine/Common/EventManager.php#L126-L135 – Ocramius