本文整理汇总了PHP中Section::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::delete方法的具体用法?PHP Section::delete怎么用?PHP Section::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
public static function remove($name)
{
$sectionManager = new Section();
$sectionManager->load(array('label' => $name));
$rightManager = new Right();
$rightManager->delete(array('section' => $sectionManager->getId()));
$sectionManager->delete(array('id' => $sectionManager->getId()));
}
示例2: __actionDelete
public function __actionDelete(array $sections, $redirect)
{
$success = true;
$callback = Administration::instance()->getPageCallback();
$current_page = $callback['pageroot'] . (isset($callback['context'][0]) && $callback['context'][0] != 'index' ? $callback['context'][0] . '/' : NULL);
foreach ($sections as $handle) {
try {
Section::delete(Section::loadFromHandle($handle));
###
# Delegate: SectionPostDelete
Extension::notify('SectionPostDelete', $current_page, array('handle' => $handle));
} catch (SectionException $e) {
$success = false;
$this->alerts()->append($e->getMessage(), AlertStack::ERROR, $e);
} catch (Exception $e) {
$success = false;
$this->alerts()->append(__('An unknown error has occurred. <a class="more">Show trace information.</a>'), AlertStack::ERROR, $e);
}
}
if ($success) {
redirect($redirect);
}
}
示例3: delete
/**
* delete section from system
*
* @return void
*/
public function delete($id)
{
$s = new Section($id);
$s->delete();
redirect('section_editor');
}
示例4: Publication
$f_issue_number = Input::Get('f_issue_number', 'int', 0);
$f_language_id = Input::Get('f_language_id', 'int', 0);
$f_section_number = Input::Get('f_section_number', 'int', 0);
$f_delete_all_section_translations = Input::Get('f_delete_all_section_translations', 'string', '', true);
$f_delete_all_articles_translations = Input::Get('f_delete_all_articles_translations', 'string', '', true);
$publicationObj = new Publication($f_publication_id);
$issueObj = new Issue($f_publication_id, $f_language_id, $f_issue_number);
$sectionObj = new Section($f_publication_id, $f_issue_number, $f_language_id, $f_section_number);
$sectionName = $sectionObj->getName();
$articles = Article::GetArticles($f_publication_id, $f_issue_number, $f_section_number, $f_language_id);
$numArticles = count($articles);
$numArticlesDeleted = 0;
$f_delete_all_section_translations = $f_delete_all_section_translations == 'Y' ? true : false;
$f_delete_all_articles_translations = $f_delete_all_articles_translations == 'Y' ? true : false;
if ($f_delete_all_section_translations == false) {
$numArticlesDeleted = $sectionObj->delete(true, $f_delete_all_articles_translations);
$cacheService = \Zend_Registry::get('container')->getService('newscoop.cache');
$cacheService->clearNamespace('section');
} else {
$sectionTranslations = Section::GetSections($f_publication_id, $f_issue_number, null, null, $sectionObj->getName(), null);
foreach ($sectionTranslations as $key => $sectionTranslation) {
$numArticlesDeleted += $sectionTranslation->delete(true, $f_delete_all_articles_translations);
}
}
$offsetVarName = 'SectOffs_' . $f_publication_id . '_' . $f_issue_number . '_' . $f_language_id;
$SectOffs = camp_session_get($offsetVarName, 0);
$totalSections = Section::GetTotalSections($f_publication_id, $f_issue_number, $f_language_id);
if ($SectOffs >= $totalSections) {
camp_session_set($offsetVarName, 0);
}
$topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj);
示例5: Widget
<?php
require_once 'Widget.class.php';
$table = new Widget();
$table->drop();
$table_section = new Section();
$id_section = $table_section->load(array("label" => "dashboard"))->getId();
$table_section->delete(array('label' => 'dashboard'));
$table_right = new Right();
$table_right->delete(array('section' => $id_section));
示例6: KodiCmd
<?php
require_once 'KodiCmd.class.php';
// Suppression de la table du plugin
$table = new KodiCmd();
//$table->drop();
$execQuery = $table->query('DROP TABLE yana_plugin_kodi');
$table_configuration = new configuration();
$table_configuration->getAll();
$table_configuration->remove('plugin_kodiCmd_api_url_kodi');
$table_configuration->remove('plugin_kodiCmd_api_timeout_kodi');
$table_configuration->remove('plugin_kodiCmd_api_recognition_status');
// suppression de la piece KODI
$table_room = new Room();
$table_room->delete(array('name' => 'KODI'));
// Recuperation de l'id et Suppression de la section
$table_section = new Section();
$id_section = $table_section->load(array("label" => "kodi"))->getId();
$table_section->delete(array('label' => 'kodi'));
// suppression des droits correspondant à la section
$table_right = new Right();
$table_right->delete(array('section' => $id_section));
示例7: Sensor
<?php
/*
Le code contenu dans cette page ne sera éxecuté qu'à la désactivation du plugin
Vous pouvez donc l'utiliser pour supprimer des tables SQLite, des dossiers, ou executer une action
*/
require_once 'Sensor.class.php';
require_once 'SensorType.class.php';
$table = new Sensor();
$table2 = new SensorType();
$table->drop();
$table2->drop();
$conf = new Configuration();
$conf->delete(array('key' => 'plugin_sensor_receptor_pin'));
$table_section = new Section();
$id_section = $table_section->load(array("label" => "sensor"))->getId();
$id_section2 = $table_section->load(array("label" => "sensortypes"))->getId();
$table_section->delete(array('label' => 'sensor'));
$table_section2->delete(array('label' => 'sensortypes'));
$table_right = new Right();
$table_right->delete(array('section' => $id_section));
$table_right->delete(array('section' => $id_section2));