Esempio n. 1
0
 /**
  * Interal mechanism to remove LanguageVariants from Localization
  * 
  * @param Localization $model
  * @param mixed $data
  */
 protected function doRemoveLanguageVariants(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->removeLanguageVariant($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }