/** * Store pet into database * * @param array $input * @return boolean */ public function createPet($input) { $result = Pet::validate($input); if (!is_bool($result)) { return $this->setMessage($result); } $pet = new Pet(); $pet->pet_name = $input['name']; $pet->description = $input['description']; $pet->save(); return $result; }