本文整理汇总了PHP中Entry::deleteEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::deleteEntry方法的具体用法?PHP Entry::deleteEntry怎么用?PHP Entry::deleteEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::deleteEntry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
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());
}
}
示例2: delete
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());
}
}
示例3: delete
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: Entry
<?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';