Esempio n. 1
0
 public function destroy($id)
 {
     if (!$this->session_broken) {
         try {
             $query = new Query($this->dbconnection);
             $query->sql("\n                    Delete from `" . static::$tablename . "` where id = ?\n                ", $id);
             $query->execute();
             if ($this->write) {
                 $query->commit();
                 $this->write = false;
                 $this->lock = false;
             }
             return true;
         } catch (\Automatorm\Exception\Database $e) {
             $this->session_broken = true;
             throw new Exception\Session('DESTROY', $e);
         }
     }
     return false;
 }