Exemplo n.º 1
0
 public function delete($gid)
 {
     if ($this->db->tableExists($this->tableName)) {
         $query = 'DELETE FROM :::table WHERE gid=:gid';
         $bindings = array(':::table' => $this->tableName, ':gid' => $gid);
         $this->db->execute($query, $bindings);
         return (bool) $this->db->affectedRows() === 1;
     }
     return false;
 }
Exemplo n.º 2
0
 public function delete($id)
 {
     if (!$this->db->tableExists($this->table)) {
         return false;
     }
     $query = "DELETE from :::table WHERE id=:id";
     $bindings = array(':::table' => $this->table, ':id' => $id);
     $this->db->execute($query, $bindings);
     if ($this->db->affectedRows() > 0) {
         return true;
     }
 }
Exemplo n.º 3
0
 public function deleteAll($gid)
 {
     if ($this->db->tableExists($this->table)) {
         $query = "DELETE FROM :::table WHERE gid=:gid";
         $bindings = array(':::table' => $this->table, ':gid' => $gid);
         $this->db->execute($query, $bindings);
         if ($this->db->affectedRows() > 0) {
             return true;
         }
         return false;
     }
 }
Exemplo n.º 4
0
 public function deleteOldest()
 {
     if ($this->useTimestamps) {
         $tableName = $this->table;
         if ($this->db->tableExists($tableName) && $this->db->fieldExists($tableName, 'ts')) {
             $query = "DELETE FROM :::table ORDER BY ts LIMIT 1";
             $bindings = array(':::table' => $tableName);
             $this->db->execute($query, $bindings);
             if ($this->db->affectedRows() === 1) {
                 return true;
             }
         }
     }
     return false;
 }