本文整理匯總了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]);
}