protected function doAddObjects(Sport $model, $data) {
		$errors = [];
		foreach ($data as $entry) {
			if (!isset($entry['id'])) {
				$errors[] = 'Missing id for Object';
			} else {
				$related = ObjectQuery::create()->findOneById($entry['id']);
				$model->addObject($related);
			}
		}

		if (count($errors) > 0) {
			return new ErrorsException($errors);
		}
	}
protected function doAddObjects(Sport $model, $data) {
		$errors = [];
		foreach ($data as $entry) {
			if (!isset($entry['id'])) {
				$errors[] = 'Missing id for Object';
			} else {
				$related = ObjectQuery::create()->findOneById($entry['id']);
				$model->addObject($related);
			}
		}

		if (count($errors) > 0) {
			return new ErrorsException($errors);
		}
	}
protected function doAddObjects ( Sport $ model , $ data ) { $ errors = [ ] ; foreach ( $ data as $ entry ) { if ( ! isset ( $ entry [ 'id' ] ) ) { $ errors [ ] = 'Missing id for Object' ; } else { $ related = ObjectQuery :: create ( ) -> findOneById ( $ entry [ 'id' ] ) ; $ model -> addObject ( $ related ) ; } } if ( count ( $ errors ) > 0 ) { return new ErrorsException ( $ errors ) ; } }
Interal mechanism to add Objects to Sport

@param Sport $model
@param mixed $data
Interal mechanism to add Objects to Sport