/** * Delete the current object in database * * @return integer Affected rows * @throws \Allty\Simple\Exception */ public final function delete() { if ($this->exists()) { return $this->getDbConnection()->delete($this->getTableName(), $this->getPkEquality()) === 1; } throw Exception::noPrimaryKeyToDeleteBy(); }