om = $om; } public static function getSubscribedEvents() { return array( JobEvents::FINISHED => array($this, 'onJobFinish'), ); } public function onJobFinish(JobFinishedEvent $event) { $this->om->remove($event->getTask()); $this->om->flush(); } }