Beispiel #1
0
 /**
  * Interal mechanism to add LanguageVariants to Localization
  * 
  * @param Localization $model
  * @param mixed $data
  */
 protected function doAddLanguageVariants(Localization $model, $data)
 {
     $errors = [];
     foreach ($data as $entry) {
         if (!isset($entry['id'])) {
             $errors[] = 'Missing id for LanguageVariant';
         } else {
             $related = LanguageVariantQuery::create()->findOneById($entry['id']);
             $model->addLanguageVariant($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }