コード例 #1
0
 /**
  * Interal mechanism to remove Localizations from Localization
  * 
  * @param Localization $model
  * @param mixed $data
  */
 protected function doRemoveLocalizations(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->removeLocalization($related);
         }
     }
     if (count($errors) > 0) {
         return new ErrorsException($errors);
     }
 }