om = $om; } /** * {@inheritdoc} */ public static function getSubscribedEvents() { return [ JobEvents::FINISHED => [$this, 'onJobFinish'], ]; } public function onJobFinish(JobFinishedEvent $event) { $this->om->remove($event->getTask()); $this->om->flush(); } }