Esempio n. 1
0
 /**
  * Interal mechanism to add Localizations to Localization
  * 
  * @param Localization $model
  * @param mixed $data
  */
 protected function doAddLocalizations(Localization $model, $data)
 {
     $errors = [];
     foreach ($data as $entry) {
         if (!isset($entry['id'])) {
             $errors[] = 'Missing id for Localization';
         } else {
             $related = LocalizationQuery::create()->findOneById($entry['id']);
             $model->addLocalization($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }