public function afterRemove(Entity $entity, $options) { parent::afterRemove($entity, $options); $pdo = $this->getEntityManager()->getPDO(); $query = $this->getEntityManager()->getQuery(); $pathsTableName = $query->toDb($entity->getEntityType() . 'Path'); $sql = "DELETE FROM `" . $pathsTableName . "` WHERE descendor_id = " . $pdo->quote($entity->id) . ""; $pdo->query($sql); }
protected function afterRemove(Entity $entity, array $options = array()) { if ($entity->get('fileId')) { $attachment = $this->getEntityManager()->getEntity('Attachment', $entity->get('fileId')); if ($attachment) { $this->getEntityManager()->removeEntity($attachment); } } $pdo = $this->getEntityManager()->getPDO(); $sql = "DELETE FROM import_entity WHERE import_id = :importId"; $sth = $pdo->prepare($sql); $sth->bindValue(':importId', $entity->id); $sth->execute(); parent::afterRemove($entity, $options); }
protected function afterRemove(Entity $entity, array $options = array()) { parent::afterRemove($entity, $options); $this->getFileManager()->removeFile('data/upload/' . $entity->id); }
protected function afterRemove(Entity $entity) { parent::afterRemove($entity); $this->getFileManager()->removeFile('data/upload/' . $entity->id); }