本文整理汇总了PHP中DbManager::_delete方法的典型用法代码示例。如果您正苦于以下问题:PHP DbManager::_delete方法的具体用法?PHP DbManager::_delete怎么用?PHP DbManager::_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbManager
的用法示例。
在下文中一共展示了DbManager::_delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _delete
protected function _delete($id_arr)
{
function find_children($id, $db)
{
//получаем детей категории
$children = $db->getCol('SELECT `id` FROM # WHERE `parent`=?i', $id);
$child_id = $children;
foreach ($children as $child) {
$child_id = array_merge($child_id, find_children($child, $db));
}
return $child_id;
}
$deleted_id = [];
foreach ($id_arr as $id) {
$deleted_id[] = $id;
$deleted_id = array_merge($deleted_id, find_children($id, $this->db));
}
$deleted_id = array_unique($deleted_id);
parent::_delete($deleted_id);
//изменяем категорию на "Без категории" у элемнтов из удаленных категорий
//$this->db->query('UPDATE ##content_articles SET `category`=0 WHERE `category` IN(?a)', [$deleted_id]);
}
示例2: _delete
public function _delete($id_list)
{
parent::_delete($id_list);
$this->db->query('DELETE FROM ##url_redirects WHERE `comment` IN(?a)', [$id_list]);
}
示例3: _delete
protected function _delete($id_arr)
{
parent::_delete($id_arr);
$this->db->query('DELETE FROM ##feedback_fields WHERE `form_id` IN(?a)', [$id_arr]);
}