Пример #1
0
 /**
  * Returns the person with the given id
  * 
  * @throws \InvalidArgumentException
  * @throws \OutOfBoundsException
  * @param int $id
  * @return \Foodalizr\Model\Person
  */
 public function find($id)
 {
     list($name) = parent::find($id);
     
     $person = new Model\Person();
     $person->setId($id);
     $person->setName($name);
     return $person;
 }
Пример #2
0
 /**
  * Returns the meal with the given id
  * 
  * @throws \InvalidArgumentException
  * @throws \OutOfBoundsException
  * @param int $id
  * @return \Foodalizr\Model\Meal
  */
 public function find($id)
 {
     list($name, $date) = parent::find($id);
     
     $meal = new Model\Meal();
     $meal->setId($id);
     $meal->setName($name);
     $meal->setDate(new Date($date));
     return $meal;
 }