예제 #1
0
 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);
 }
예제 #2
0
파일: Import.php 프로젝트: chinazan/zzcrm
 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);
 }
예제 #3
0
 protected function afterRemove(Entity $entity, array $options = array())
 {
     parent::afterRemove($entity, $options);
     $this->getFileManager()->removeFile('data/upload/' . $entity->id);
 }