original_string: protected function getModelMetaReferenceData($modelClass, $type, $key)
      {
          // Find out of the model is part of the CMS
          $info = $this->getCmsModelInformation($modelClass);
  
          // Model information is required, since it is used to determine the returned
          // reference strategy and source to use.
          if ( ! $info) {
              abort(404, "{$modelClass} is not a CMS model");
          }
  
          // If multiple models are defined, get reference data for each model
          $nestedModels = $this->referenceDataProvider->getNestedModelClassesByType($info, $type, $key);
  
          if (false !== $nestedModels) {
  
              $data = [];
  
              foreach ($nestedModels as $nestedModelClass) {
                  $data[ $nestedModelClass ] = $this->referenceDataProvider
                      ->getForInformationByType($info, $type, $key, $nestedModelClass);
              }
  
          } else {
              $data = $this->referenceDataProvider->getForInformationByType($info, $type, $key);
          }
  
          if ( ! $data) {
              abort(404, "Could not retrieve reference data for {$type}, key: {$key}");
          }
  
          return $data;
      }
code: protected function getModelMetaReferenceData($modelClass, $type, $key)
      {
          // Find out of the model is part of the CMS
          $info = $this->getCmsModelInformation($modelClass);
  
          // Model information is required, since it is used to determine the returned
          // reference strategy and source to use.
          if ( ! $info) {
              abort(404, "{$modelClass} is not a CMS model");
          }
  
          // If multiple models are defined, get reference data for each model
          $nestedModels = $this->referenceDataProvider->getNestedModelClassesByType($info, $type, $key);
  
          if (false !== $nestedModels) {
  
              $data = [];
  
              foreach ($nestedModels as $nestedModelClass) {
                  $data[ $nestedModelClass ] = $this->referenceDataProvider
                      ->getForInformationByType($info, $type, $key, $nestedModelClass);
              }
  
          } else {
              $data = $this->referenceDataProvider->getForInformationByType($info, $type, $key);
          }
  
          if ( ! $data) {
              abort(404, "Could not retrieve reference data for {$type}, key: {$key}");
          }
  
          return $data;
      }
code_tokens: protected function getModelMetaReferenceData ( $ modelClass , $ type , $ key ) { // Find out of the model is part of the CMS $ info = $ this -> getCmsModelInformation ( $ modelClass ) ; // Model information is required, since it is used to determine the returned // reference strategy and source to use. if ( ! $ info ) { abort ( 404 , "{$modelClass} is not a CMS model" ) ; } // If multiple models are defined, get reference data for each model $ nestedModels = $ this -> referenceDataProvider -> getNestedModelClassesByType ( $ info , $ type , $ key ) ; if ( false !== $ nestedModels ) { $ data = [ ] ; foreach ( $ nestedModels as $ nestedModelClass ) { $ data [ $ nestedModelClass ] = $ this -> referenceDataProvider -> getForInformationByType ( $ info , $ type , $ key , $ nestedModelClass ) ; } } else { $ data = $ this -> referenceDataProvider -> getForInformationByType ( $ info , $ type , $ key ) ; } if ( ! $ data ) { abort ( 404 , "Could not retrieve reference data for {$type}, key: {$key}" ) ; } return $ data ; }
docstring: Returns reference data from CMS model information, by type.
  
  Note that this may return either a single reference object,
  or an array of them, depending on the type of form field data.
  
  @param $modelClass
  @param $type
  @param $key
  @return ModelMetaReference|ModelMetaReference[]|false
docstring_tokens: Returns reference data from CMS model information by type .