Ejemplo n.º 1
0
 /**
  * Interal mechanism to add Activities to ActivityObject
  * 
  * @param ActivityObject $model
  * @param mixed $data
  */
 protected function doAddActivities(ActivityObject $model, $data)
 {
     $errors = [];
     foreach ($data as $entry) {
         if (!isset($entry['id'])) {
             $errors[] = 'Missing id for Activity';
         } else {
             $related = ActivityQuery::create()->findOneById($entry['id']);
             $model->addActivity($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }