private function _findById($value)
{
if (!$this->_modelDefinition->primaryKey) {
throw new DbException('Primary key is not defined for table ' . $this->_modelDefinition->table);
}
$result = $this->_findByIdOrNull($value);
if ($result) {
return $result;
}
throw new DbException($this->_modelDefinition->table . " with " . $this->_modelDefinition->primaryKey . "=" . $value . " not found");
}