Exemplo n.º 1
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;
 }