/**
  * Deletes a record from the database.
  *
  * @access  protected
  * @param   \mako\database\midgard\Query  $query  Query builder
  * @return  boolean
  */
 protected function deleteRecord($query)
 {
     $lockingColumn = $this->getLockingColumn();
     $query->where($lockingColumn, '=', $this->columns[$lockingColumn]);
     $deleted = parent::deleteRecord($query);
     if (!$deleted) {
         throw new StaleRecordException(vsprintf("%s(): Attempted to delete a stale record.", [__METHOD__]));
     }
     return $deleted;
 }
Beispiel #2
0
 /**
  * Deletes a record from the database.
  *
  * @access  protected
  * @param   \mako\database\midgard\Query  $query  Query builder
  * @return  boolean
  */
 protected function deleteRecord($query)
 {
     return (bool) $query->where($this->primaryKey, '=', $this->columns[$this->primaryKey])->delete();
 }