/** * Delete objects preRemove instead of postRemove so that we have access to the id. Because this is called * preRemove, first check that the entity is managed by Doctrine */ public function preRemove(EventArgs $eventArgs) { $entity = $this->getDoctrineObject($eventArgs); if ($this->objectPersister->handlesObject($entity)) { $this->scheduleForDeletion($entity); } }
/** * @param ProductInterface $product */ private function addScheduledForUpdate(ProductInterface $product) { if ($this->objectPersister->handlesObject($product)) { $this->scheduledForUpdate[] = $product; } }