本文整理汇总了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;
}
}
示例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);
}
}
}
}
}
}
示例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);
}
}
}
}
示例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