protected function prepareCubeRequestQueries(CubeQueryRequest $request, CubeMetaData $cube, array $parameters = NULL)
 {
     if (!isset($parameters)) {
         return;
     }
     $metamodel = data_controller_get_metamodel();
     foreach ($parameters as $parameterName => $parameterValues) {
         list($elementName, $subElementName, $propertyName) = ParameterHelper::splitName($parameterName);
         list($referencedDatasetName, $referencedElementName) = ReferencePathHelper::splitReference($elementName);
         // checking that referenced cube exists
         $referencedCube = isset($referencedDatasetName) ? $metamodel->getCubeByDatasetName($referencedDatasetName) : NULL;
         if (isset($subElementName)) {
             if (isset($referencedCube)) {
                 throw new IllegalArgumentException(t('Referenced dimensions are not supported'));
             }
             // checking the level exists
             $dimension = $cube->getDimension($elementName);
             $level = $dimension->getLevel($subElementName);
             // adding the dimension level related query
             $request->addDimensionLevelPropertyQueryValues($elementName, $subElementName, $propertyName, $parameterValues);
         } else {
             $selectedRequest = $request;
             if (isset($referencedCube)) {
                 $measure = $referencedCube->findMeasure($referencedElementName);
                 $selectedRequest = $request->registerReferencedRequest($referencedCube->name);
             } else {
                 // checking if the measure exists
                 $measure = $cube->findMeasure($referencedElementName);
             }
             if (isset($measure)) {
                 // adding measure query
                 $selectedRequest->addMeasureQueryValues($referencedElementName, $parameterValues);
             } else {
                 // adding dataset column-based query
                 $selectedRequest->addSourceDatasetPropertyQueryValues($referencedElementName, $parameterValues);
             }
         }
     }
 }