Faq::delete PHP Метод

delete() публичный Метод

public delete ( $id )
    public function delete($id)
    {
        if ($this->user->getClass() < User::CLASS_ADMIN) {
            throw new Exception(L::get("PERMISSION_DENIED"), 401);
        }
        $sth = $this->db->prepare("DELETE FROM faq WHERE id = ?");
        $sth->bindParam(1, $id, PDO::PARAM_INT);
        $sth->execute();
    }

Usage Example

Пример #1
0
 function delete($id = FALSE)
 {
     if ($id) {
         $faq = new Faq($id);
         $faq->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
All Usage Examples Of Faq::delete