当前位置: 首页>>代码示例>>PHP>>正文


PHP MetaModel::getDataset方法代码示例

本文整理汇总了PHP中MetaModel::getDataset方法的典型用法代码示例。如果您正苦于以下问题:PHP MetaModel::getDataset方法的具体用法?PHP MetaModel::getDataset怎么用?PHP MetaModel::getDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MetaModel的用法示例。


在下文中一共展示了MetaModel::getDataset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getExportDatasetName

    public static function getExportDatasetName ( $datasetName, MetaModel $metamodel ) {
        $logicalDatasetName = StarSchemaNamingConvention::findFactsOwner($datasetName);

        if (isset($logicalDatasetName)) {
            $dataset = $metamodel->getDataset($logicalDatasetName);
            return isset($dataset->uuid) ? StarSchemaNamingConvention::getFactsRelatedName($dataset->uuid) : null;
        } else {
            $dataset = $metamodel->getDataset($datasetName);
            return isset($dataset->uuid) ? $dataset->uuid : null;
        }
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:11,代码来源:DatasetExportHelper.php

示例2: restoringDatasetReferences

 protected function restoringDatasetReferences(MetaModel $metamodel)
 {
     // restoring references to ...
     foreach ($metamodel->cubes as $cube) {
         // ... cube source dataset
         $cube->sourceDataset = $metamodel->getDataset($cube->sourceDatasetName);
         if (isset($cube->dimensions)) {
             foreach ($cube->dimensions as $dimension) {
                 foreach ($dimension->levels as $level) {
                     // ... level datasets
                     if (isset($level->datasetName)) {
                         $level->dataset = $metamodel->getDataset($level->datasetName);
                     }
                 }
             }
         }
     }
 }
开发者ID:ecs-hk,项目名称:Checkbook,代码行数:18,代码来源:MetaModelFactory.php

示例3: prepareDatasetSequence


//.........这里部分代码省略.........
                    continue;
                }

                $referencePointIndexes4Reference = isset($transitionalReferencePointIndexes4References[$referenceName])
                    ? $transitionalReferencePointIndexes4References[$referenceName]
                    : NULL;
            }

            // registering the reference in a stack to avoid excessive calls
            // registration was moved here because we could have date[->month->quarter->year] and year columns in one dataset
            // if references related to date and year are registered before we start to process individual references
            // we will end up with nested links for date->month->quarter->year which do not contain a reference to year
            // which leads to GOVDB-1313 issue
            $callcontext->referenceNameStack[$reference->name] = TRUE;

            // preparing dataset names for each reference point
            $referencePointDatasetNames = NULL;
            for ($referencePointColumnIndex = 0; $referencePointColumnIndex < $referencePointColumnCount; $referencePointColumnIndex++) {
                foreach ($referencePointIndexes4Reference[$referencePointColumnIndex] as $referencePointIndex => $directReferencePointFlag) {
                    $referencePointColumn = $reference->points[$referencePointIndex]->columns[$referencePointColumnIndex];
                    $datasetName = $referencePointColumn->datasetName;

                    // it is expected that dataset name is the same for all columns in a reference point
                    if (isset($referencePointDatasetNames[$referencePointIndex])) {
                        if ($referencePointDatasetNames[$referencePointIndex] != $datasetName) {
                            // Dataset name is not the same for all columns for the reference point
                            $referencePointDatasetNames[$referencePointIndex] = FALSE;
                        }
                    }
                    else {
                        $referencePointDatasetNames[$referencePointIndex] = $datasetName;
                    }
                }
            }
            // removing all reference points which we cannot support now
            foreach ($referencePointDatasetNames as $referencePointIndex => $datasetName) {
                if ($datasetName === FALSE) {
                    unset($referencePointDatasetNames[$referencePointIndex]);
                }
            }
            // if nothing left there is not need to proceed
            if (count($referencePointDatasetNames) == 0) {
                continue;
            }

            // preparing list of parent column names
            $parentColumnNames = NULL;
            for ($referencePointColumnIndex = 0; $referencePointColumnIndex < $referencePointColumnCount; $referencePointColumnIndex++) {
                $parentReferencePointIndex = $parentReferencePointIndex4Reference[$referencePointColumnIndex];
                $parentReferencePointColumnName = $reference->points[$parentReferencePointIndex]->columns[$referencePointColumnIndex]->columnName;

                $parentColumnNames[$referencePointColumnIndex] = $parentReferencePointColumnName;
            }

            $referenceCallContext = $isDirectReference ? $callcontext : (clone $callcontext);

            // adding all indirect datasets in stack to prevent recursive calls
            if (!$isDirectReference) {
                foreach ($referencePointDatasetNames as $referencePointIndex => $datasetName) {
                    if (isset($referenceCallContext->datasetNameStack[$datasetName])) {
                        unset($referencePointDatasetNames[$referencePointIndex]);
                    }
                    else {
                        $referenceCallContext->datasetNameStack[$datasetName] = TRUE;
                    }
                }
            }

            foreach ($referencePointDatasetNames as $referencePointIndex => $datasetName) {
                // looking for existing link
                $referencedLink = $link->findNestedLinkByDatasetNameAndParentColumnNames($datasetName, $parentColumnNames);
                if (!isset($referencedLink)) {
                    $dataset = $metamodel->getDataset($datasetName);

                    $referencedLink = new ReferenceLink($dataset);
                    foreach ($parentColumnNames as $referencePointColumnIndex => $parentReferencePointColumnName) {
                        $referencePointColumn = $reference->points[$referencePointIndex]->columns[$referencePointColumnIndex];
                        $referencedLink->linkColumnWithParent($referencePointColumnIndex, $parentReferencePointColumnName, $referencePointColumn->columnName);
                    }

                    $link->registerNestedLink($referencedLink);
                }
                ArrayHelper::addUniqueValue($referencedLink->referenceNames, $referenceName);

                // marking the link as required for the branch so it will not be deleted by the optimizer later
                if ($isDirectReference) {
                    $referencedLink->required = TRUE;
                }

                // because this reference path is not processed completely we need to continue scanning this branch
                if (isset($nestedReferencePath)) {
                    LogHelper::log_debug(t(
                        'Checking sub-path[linkId: @linkId; stackSize: @stackSize]: @referencePath',
                        array('@linkId' => $referencedLink->linkId, '@stackSize' => count($callcontext->referenceNameStack), '@referencePath' => $referencePath)));
                    $referencePointCallContext = clone $referenceCallContext;
                    $this->prepareDatasetSequence($referencePointCallContext, $metamodel, $referencedLink, $nestedReferencePath);
                }
            }
        }
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:101,代码来源:ReferenceLinkBuilder.php

示例4: prepareDimension

    public function prepareDimension(MetaModel $metamodel, DatasetMetaData $dataset, $columnName, CubeMetaData $cube) {
        $column = $cube->factsDataset->getColumn($columnName);
        $dimension = $cube->getDimension($columnName);

        $referencedCube = $metamodel->findCube($this->datasetName);
        // TODO DHS Management Cube (we do not have cubes for lookups)
        $referencedDatasetName = isset($referencedCube) ? $referencedCube->factsDatasetName : $this->datasetName;

        // preparing dimension properties
        $dimension->attributeColumnName = $columnName;

        // preparing dimension dataset
        $dimension->setDatasetName($this->datasetName);
        $dimension->dataset = $metamodel->getDataset($dimension->datasetName);

        // facts dataset column contains a reference to lookup
        // TODO DHS Management Cube (column type has been already prepared)
        if (!isset($column->type->applicationType)) {
            $column->initializeTypeFrom(Sequence::getSequenceColumnType());
        }

        // adding a reference to dimension dataset
        $referenceName = $referencedDatasetName;
        $metamodel->registerSimpleReferencePoint($referenceName, $referencedDatasetName, NULL);
        $metamodel->registerSimpleReferencePoint($referenceName, $cube->factsDatasetName, $columnName);
        // ... to support retrieving properties of the dimension dataset
        $metamodel->registerSimpleReferencePoint($referenceName, $dimension->datasetName, $dimension->dataset->getKeyColumn()->name);
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:28,代码来源:LookupDatasetColumnDimensionLookupHandler.php


注:本文中的MetaModel::getDataset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。