Beispiel #1
0
 /**
  * Instantiate a Pet from an image table id
  * @param int $petId  id of pet row to create a Pet instance from  
  * @return \Pet
  */
 public static function constructById($petId)
 {
     $row = Model\Pet::getPetById($petId);
     $row = isset($row[0]) ? $row[0] : $row;
     if (isset($row['id'])) {
         $pet = self::constructByRow($row);
         $pet->setId($row['id']);
         return $pet;
     }
     return null;
 }