/** * finds a user from Database based on ID and returns a User object located * in memory. * * @param int $id * * @throws \InvalidArgumentException * * @return User */ public function findById($id) { $result = $this->adapter->find($id); if (0 == count($result)) { throw new \InvalidArgumentException("User #{$id} not found"); } $row = $result->current(); return $this->mapObject($row); }
public function find($conditions = null, $fields = '*') { if (empty($conditions)) { return parent::find($this->dbtable, $fields); } else { return parent::findBy($this->dbtable, $fields, $conditions); } }