本文整理匯總了PHP中Backend\Core\Engine\Model::deleteExtraById方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::deleteExtraById方法的具體用法?PHP Model::deleteExtraById怎麽用?PHP Model::deleteExtraById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Backend\Core\Engine\Model
的用法示例。
在下文中一共展示了Model::deleteExtraById方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
/**
* Delete a certain user
*
* @param int $id
*/
public static function delete($id)
{
$record = self::get($id);
// delete extra
BackendModel::deleteExtraById($record['extra_id'], true);
// delete user id
BackendModel::get('database')->delete('instagram_users', 'id = ?', (int) $id);
}
示例2: delete
/**
* Delete an item
*
* @param int $id The id of the record to delete.
*/
public static function delete($id)
{
// get db
$db = BackendModel::getContainer()->get('database');
// get item
$item = self::get($id);
BackendModel::deleteExtraById($item['extra_id']);
// delete location and its settings
$db->delete('location', 'id = ? AND language = ?', array((int) $id, BL::getWorkingLanguage()));
$db->delete('location_settings', 'map_id = ?', array((int) $id));
}
示例3: deleteCategory
/**
* Delete a specific category
*
* @param int $id
*/
public static function deleteCategory($id)
{
$db = BackendModel::getContainer()->get('database');
$item = self::getCategory($id);
if (!empty($item)) {
$db->delete('meta', 'id = ?', array($item['meta_id']));
$db->delete('faq_categories', 'id = ?', array((int) $id));
$db->update('faq_questions', array('category_id' => null), 'category_id = ?', array((int) $id));
BackendModel::deleteExtraById($item['extra_id']);
}
}
示例4: delete
/**
* Delete an item.
*
* @param int $id The id of the record to delete.
*/
public static function delete($id)
{
// recast id
$id = (int) $id;
// get item
$item = self::get($id);
// delete extra and pages_blocks
BackendModel::deleteExtraById($item['extra_id']);
// delete the content_block
BackendModel::getContainer()->get('database')->delete('content_blocks', 'id = ? AND language = ?', array($id, BL::getWorkingLanguage()));
}
示例5: deleteCategory
/**
* Delete a specific category
*
* @param int $id
*/
public static function deleteCategory($id)
{
$db = BackendModel::getContainer()->get('database');
$item = self::getCategory($id);
if (!empty($item)) {
$db->delete('meta', 'id = ?', array($item['meta_id']));
$db->delete('catalog_categories', 'id = ?', array((int) $id));
$db->delete('catalog_categories_lang', 'id = ?', array((int) $id));
$db->update('catalog_products', array('category_id' => null), 'category_id = ?', array((int) $id));
// delete extra and pages_blocks
BackendModel::deleteExtraById($item['extra_id']);
}
}
示例6: delete
/**
* Delete an item.
*
* @param int $id The id of the record to delete.
*
* @deprecated use doctrine instead
*/
public static function delete($id)
{
trigger_error('Backend\\Modules\\ContentBlocks\\Engine is deprecated.
Switch to doctrine instead.', E_USER_DEPRECATED);
// recast id
$id = (int) $id;
// get item
$item = self::get($id);
// delete extra and pages_blocks
BackendModel::deleteExtraById($item['extra_id']);
// delete the content_block
BackendModel::getContainer()->get('database')->delete('content_blocks', 'id = ? AND language = ?', [$id, BL::getWorkingLanguage()]);
}
示例7: handle
/**
* @param DeleteContentBlock $deleteContentBlock
*
* @return ContentBlock
*/
public function handle(DeleteContentBlock $deleteContentBlock)
{
$this->contentBlockRepository->removeByIdAndLocale($deleteContentBlock->contentBlock->getId(), $deleteContentBlock->contentBlock->getLocale());
Model::deleteExtraById($deleteContentBlock->contentBlock->getExtraId());
}