本文整理汇总了PHP中My_Model::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP My_Model::delete方法的具体用法?PHP My_Model::delete怎么用?PHP My_Model::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类My_Model
的用法示例。
在下文中一共展示了My_Model::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete a group
*
*
* @param int $id The ID of the group to delete
* @return
*/
public function delete($id = 0)
{
$this->load->model('users/user_m');
// don't delete the group if there are still users assigned to it
if ($this->user_m->count_by(array('group_id' => $id)) > 0) {
return false;
}
// Dont let them delete the "admin" group or the "user" group.
// The interface does not have a delete button for these, this is just insurance
$this->db->where_not_in('name', array('user', 'admin'));
return parent::delete($id);
}