Example #1
0
 /**
  *
  * @SWG\Api(
  *   path="/meeting/{uuid}/delta",
  *   description="API for meeting actions",
  * @SWG\Operation(
  *    method="POST",
  *    type="MeetingDelta",
  *    summary="Post a screen update to a meeting",
  * @SWG\Parameter(
  *     name="uuid",
  *     description="UUID of the meeting",
  *     paramType="path",
  *     required=true,
  *     type="string"
  *     ),
  * @SWG\Parameter(
  *     name="data",
  *     description="The json data representation of how the meeting has changed",
  *     paramType="form",
  *     required=true,
  *     type="string"
  *     ),
  *   )
  * )
  *
  * Adds a delta (change) to an ongoing meeting
  * @param string $uuid
  */
 private function meeting_delta_add($uuid = '')
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules('data', 'Data', 'trim|required|xss_clean');
     if ($this->form_validation->run() == FALSE) {
         json_error('There was a problem with your submission: ' . validation_errors(' ', ' '));
     } else {
         $meeting = validate_meeting_uuid($uuid, true);
         $delta_id = $this->Meeting_Delta->add(array('data' => $this->post('data'), 'meeting_id' => $meeting->id));
         $delta = $this->Meeting_Delta->load($delta_id);
         $this->response(decorate_meeting_delta($delta));
     }
 }
Example #2
0
function decorate_meeting_deltas($objects)
{
    $updated = array();
    foreach ($objects as $object) {
        $updated[] = decorate_meeting_delta($object);
    }
    return $updated;
}