/** * Delete entity's corresponding database row. * * @param AbstractDbEntity $dbEntity */ public function delete(AbstractDbEntity $dbEntity) { if (!$dbEntity->getPrimaryDbValue()) { throw new \InvalidArgumentException('Primary database value not set'); } $this->db->exec('DELETE FROM `' . $dbEntity->getDbTableName() . '` WHERE ' . $this->getPrimaryKeyWhereSql($dbEntity), $this->getPrimaryKeyWhereParameters($dbEntity)); $dbEntity->setDeleted(); }