public function delete()
 {
     $transaction = $this->beginTransaction();
     try {
         $idTemplate = $this->getId();
         $idEntity = $this->getIdEntity();
         // remove entry
         $entry = new Entry();
         $entry->deleteEntry($this->getEntry());
         // remove related FEs
         //Base::deleteEntity2Relation($idEntity, 'rel_elementof');
         $fe = new FrameElement();
         $fes = $this->listFEforDeletion()->asQuery()->getResult();
         foreach ($fes as $row) {
             $fe->getById($row['idFrameElement']);
             $fe->delete();
         }
         // remove this template
         parent::delete();
         // remove entity
         $entity = new Entity($idEntity);
         $entity->delete();
         $transaction->commit();
     } catch (\Exception $e) {
         $transaction->rollback();
         throw new \Exception($e->getMessage());
     }
 }
 public function delete()
 {
     $transaction = $this->beginTransaction();
     try {
         $hasChildren = count($this->listChildren($this->getId())->asQuery()->getResult()) > 0;
         if ($hasChildren) {
             throw new \Exception("Type has subtypes; it can't be removed.");
         } else {
             Base::deleteAllEntityRelation($this->getIdEntity());
             parent::delete();
             $entity = new Entity($this->getIdEntity());
             $entity->delete();
             $entry = new Entry();
             $entry->deleteEntry($this->getEntry());
             $transaction->commit();
         }
     } catch (\Exception $e) {
         $transaction->rollback();
         throw new \Exception($e->getMessage());
     }
 }
 public function delete()
 {
     $transaction = $this->beginTransaction();
     try {
         $idEntity = $this->getIdEntity();
         // remove entry
         $entry = new Entry();
         $entry->deleteEntry($this->getEntry());
         // remove frame-relations
         Base::deleteAllEntityRelation($idEntity);
         // remove this frame
         parent::delete();
         // remove entity
         $entity = new Entity($idEntity);
         $entity->delete();
         $transaction->commit();
     } catch (\Exception $e) {
         $transaction->rollback();
         throw new \Exception($e->getMessage());
     }
 }
예제 #4
0
<?php

if (!isset($_GET['id']) || $_GET['id'] == "") {
    return include 'controllers/admin/clanky.php';
}
$entryClass = new Entry();
if ($entryClass->deleteEntry($_GET['id'], $profil->getId())) {
    header('location: admin.php?page=clanky');
}
return include 'controllers/admin/clanky.php';