/** * Responds with information about newly inserted country * * @method post * @return json/xml data */ public function post($id) { $results = array(); $country = Country::findFirstById($id); if ($country) { $countryCollection = new CountryCollection(); $countryCollection->id = $country->id; $countryCollection->name = $country->name; $countryCollection->description = $country->description; $countryCollection->status = $country->status; $countryCollection->active = $country->active; $countryCollection->created = $country->created; $countryCollection->modified = $country->modified; $countryCollection->createdBy = $country->createdBy; $countryCollection->modifiedBy = $country->modifiedBy; $countryCollection->save(); $results['id'] = $country->id; } return $results; }