public find_one ( $id = null ) |
public function find_one($id = null)
{
if (!is_null($id)) {
$this->where_id_is($id);
}
$this->limit(1);
$rows = $this->_run();
if (empty($rows)) {
return false;
}
return $this->_create_instance_from_row($rows[0]);
}
/** * Wrap Idiorm's find_one method to return * an instance of the class associated with * this wrapper instead of the raw ORM class. * * @param null|integer $id * @return Model */ public function find_one($id = null) { return $this->_create_model_instance(parent::find_one($id)); }