protected function deleteFromDatabase($arg)
{
$primaryKey = $this->mapper->getPrimaryKey($this->getTable());
$idField = $this->mapper->getEntityField($this->getTable(), $primaryKey);
$id = $arg instanceof Entity ? $arg->{$idField} : $arg;
return $this->connection->query('DELETE FROM %n WHERE %n = ?', $this->getTable(), $primaryKey, $id);
}