/** * Implementation for 'POST' method for Rest API * * @param mixed $hldUid Primary key * * @return array $result Returns array within multiple records or a single record depending if * a single selection was requested passing id(s) as param */ protected function post($hldUid, $hldDate, $hldDescription) { try { $result = array(); $obj = new Holiday(); $obj->setHldUid($hldUid); $obj->setHldDate($hldDate); $obj->setHldDescription($hldDescription); $obj->save(); } catch (Exception $e) { throw new RestException(412, $e->getMessage()); } }