本文整理汇总了PHP中ArrayHelper::copy方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayHelper::copy方法的具体用法?PHP ArrayHelper::copy怎么用?PHP ArrayHelper::copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayHelper
的用法示例。
在下文中一共展示了ArrayHelper::copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __clone
public function __clone() {
parent::__clone();
$this->datasets = ArrayHelper::copy($this->datasets);
$this->references = ArrayHelper::copy($this->references);
$this->cubes = ArrayHelper::copy($this->cubes);
}
示例2: __clone
public function __clone() {
parent::__clone();
$this->groupByColumnNames = ArrayHelper::copy($this->groupByColumnNames);
$this->subjectColumnNames = ArrayHelper::copy($this->subjectColumnNames);
$this->formattedGroupByColumnNames = ArrayHelper::copy($this->formattedGroupByColumnNames);
$this->formattedSubjectColumnNames = ArrayHelper::copy($this->formattedSubjectColumnNames);
}
示例3: __clone
public function __clone() {
parent::__clone();
$this->formattedColumnNames = ArrayHelper::copy($this->formattedColumnNames);
if (isset($this->parent)) {
$this->parent = clone $this->parent;
}
}
示例4: __clone
public function __clone() {
parent::__clone();
$this->datasources = ArrayHelper::copy($this->datasources);
}
示例5: __clone
public function __clone() {
parent::__clone();
$this->type = clone $this->type;
$this->branches = ArrayHelper::copy($this->branches);
}
示例6: __clone
public function __clone() {
parent::__clone();
$this->keyColumnNames = ArrayHelper::copy($this->keyColumnNames);
}
示例7: __clone
public function __clone() {
parent::__clone();
$this->queries = ArrayHelper::copy($this->queries);
$this->sortingConfigurations = ArrayHelper::copy($this->sortingConfigurations);
}
示例8: __clone
public function __clone() {
parent::__clone();
$this->segmentLinkIds = ArrayHelper::copy($this->segmentLinkIds);
}
示例9: __clone
public function __clone() {
parent::__clone();
$this->dimensions = ArrayHelper::copy($this->dimensions);
$this->measures = ArrayHelper::copy($this->measures);
}
示例10: __clone
public function __clone() {
parent::__clone();
$this->referencedRequests = ArrayHelper::copy($this->referencedRequests);
}
示例11: __clone
public function __clone() {
parent::__clone();
$this->points = ArrayHelper::copy($this->points);
}
示例12: __clone
public function __clone() {
parent::__clone();
$this->columnMappings = ArrayHelper::copy($this->columnMappings);
}
示例13: cleanFunctionParameters
public static function cleanFunctionParameters($datasetName, $columns, $parameters, $orderBy, array $options = NULL) {
$metamodel = data_controller_get_metamodel();
$dataset = $metamodel->getDataset($datasetName);
$cleanedColumns = ArrayHelper::trim($columns);
$cleanedParameters = NULL;
if (isset($parameters)) {
foreach ($parameters as $key => $value) {
$key = StringHelper::trim($key);
// ignoring system parameters
list($elementNameSpace) = AbstractDatasetUIMetaDataGenerator::splitElementUIMetaDataName($key);
if (!isset($elementNameSpace)) {
continue;
}
$cleanedParameters[$key] = $value;
}
}
$cleanedOrderBy = NULL;
ArrayHelper::addUniqueValues($cleanedOrderBy, ArrayHelper::trim($orderBy));
$cleanedOptions = NULL;
if (isset($options)) {
foreach ($options as $name => $option) {
$cleanedOption = NULL;
if (isset($option)) {
if ($name == AbstractQueryRequest::OPTION__FORMULA_DEF) {
// cleaning all formulas
foreach ($option as $index => $formula) {
$cleanedFormula = clone $formula;
$parser = new FormulaExpressionParser($cleanedFormula->expressionLanguage);
$cleanedFormula->source = $parser->parse($cleanedFormula->source, 'DatasetUIMetaDataQueryHelper::cleanFormulaExpressionColumnNames');
$cleanedOption[$index] = $cleanedFormula;
}
// assembling clean formulas to calculate 'measure' flag
if (isset($cleanedOption)) {
$columnReferenceFactory = new CompositeColumnReferenceFactory(array(
$dataset,
new FormulaReferenceFactory($cleanedOption)));
$expressionAssembler = new FormulaExpressionAssembler($columnReferenceFactory);
foreach ($cleanedOption as $index => $cleanedFormula) {
// assembling full expressions to detect if any aggregation function present
$expression = $expressionAssembler->assemble($cleanedFormula);
// process the formula expression
$handler = FormulaExpressionLanguageFactory::getInstance()->getHandler($cleanedFormula->expressionLanguage);
$lexemes = $handler->lex($expression);
$syntaxTree = $handler->parse($lexemes);
// checking if the formula expression contains references to any aggregation functions
$cleanedFormula->isMeasure = $handler->isMeasure($syntaxTree);
}
}
}
elseif (is_array($option)) {
$cleanedOption = ArrayHelper::copy($option);
}
elseif (is_object($option)) {
$cleanedOption = clone $option;
}
else {
$cleanedOption = $option;
}
}
if (isset($cleanedOption)) {
$cleanedOptions[$name] = $cleanedOption;
}
}
}
// adjusting list of columns we need to return
$requestedColumnNames = NULL;
// preparing list of unique column names
ArrayHelper::addUniqueValues($requestedColumnNames, $cleanedColumns);
// adding columns which are used to sort result
if ($cleanedOrderBy) {
foreach ($cleanedOrderBy as $directionalColumnName) {
list($columnName, $isSortAscending) = ColumnBasedComparator_AbstractSortingConfiguration::parseDirectionalColumnName($directionalColumnName);
ArrayHelper::addUniqueValue($requestedColumnNames, $columnName);
}
}
return array($requestedColumnNames, $cleanedParameters, $cleanedOrderBy, $cleanedOptions);
}
示例14: prepareRequest4Total
public function prepareRequest4Total(AbstractQueryRequest $request) {
$expressions = $this->collectTotalExpressions($request);
if (!isset($expressions)) {
return NULL;
}
$uniqueExpressions = NULL;
foreach ($expressions as $formulaName => $totalExpressions) {
ArrayHelper::addUniqueValues($uniqueExpressions, $totalExpressions);
}
// initializing request object
$request4Total = $this->initializeRequest4Total($request);
// preparing options
$request4Total->addOptions(ArrayHelper::copy($request->options));
// adding total expressions
$totalExpressionColumnMapping = NULL;
foreach ($uniqueExpressions as $index => $expression) {
$expressionColumnName = 'sm_total_' . $index;
$formula = new FormulaMetaData();
$formula->name = $expressionColumnName;
$formula->type->applicationType = NumberDataTypeHandler::DATA_TYPE;
$formula->source = $expression;
$request4Total->addFormula($formula);
$totalExpressionColumnMapping[$expressionColumnName] = $expression;
}
$request4Total->addOption(self::OPTION__TOTAL_FORMULA_EXPRESSION, $expressions);
$request4Total->addOption(self::OPTION__TOTAL_EXPRESSION_COLUMN_MAPPING, $totalExpressionColumnMapping);
// finalizing the request
$this->finalizeRequest4Total($request, $request4Total, array_keys($totalExpressionColumnMapping));
return $request4Total;
}
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:38,代码来源:AbstractTotalInFormulaExpressionRequestProcessor.php
示例15: initializeFromDataset
public static function initializeFromDataset(MetaModel $metamodel, DatasetMetaData $dataset)
{
$cubeName = $dataset->name;
$cube = $metamodel->unregisterCube($cubeName);
// preparing cube properties
$cube->description = $dataset->description;
// preparing facts dataset
$factsDataset = $cube->initiateFactsDataset();
$factsDataset->name = $cube->factsDatasetName;
$factsDataset->publicName = $dataset->publicName;
$factsDataset->description = $dataset->description;
$factsDataset->datasourceName = $dataset->datasourceName;
$factsDataset->markAsPrivate();
$factsDataset->source = StarSchemaNamingConvention::getFactsRelatedName($dataset->source);
// calculating facts dataset aliases
if (isset($dataset->aliases)) {
foreach ($dataset->aliases as $alias) {
$factsDataset->aliases[] = StarSchemaNamingConvention::getFactsRelatedName($alias);
}
}
// preparing facts dataset columns and cube dimensions
foreach ($dataset->getColumns(FALSE) as $logicalColumn) {
// we need to preserve original column index
$column = $factsDataset->initiateColumn();
$column->name = $logicalColumn->name;
$column->columnIndex = $logicalColumn->columnIndex;
$column->publicName = $logicalColumn->publicName;
$column->description = $logicalColumn->description;
$column->key = $logicalColumn->key;
$column->persistence = $logicalColumn->persistence;
$column->source = $logicalColumn->source;
$column->visible = $logicalColumn->visible;
$column->used = $logicalColumn->used;
$column->branches = ArrayHelper::copy($logicalColumn->branches);
$factsDataset->registerColumnInstance($column);
self::initializeDimensionFromColumn($metamodel, $cube, $dataset, $logicalColumn->name);
if (isset($column->type->applicationType)) {
$column->type->logicalApplicationType = $logicalColumn->type->applicationType;
} else {
// setting column type to original column type
$column->type->applicationType = $logicalColumn->type->applicationType;
}
}
// preparing cube measures
// we do that in a separate loop because a calculated column can point to another calculated column with higher column index
foreach ($dataset->getColumns(FALSE) as $logicalColumn) {
self::initializeMeasuresFromColumn($cube, $dataset, $logicalColumn->name);
}
// marking that the facts dataset object contains complete meta data & registering it in meta model
$factsDataset->markAsComplete();
$metamodel->registerDataset($factsDataset);
// preparing cube measures
self::registerCubeMeasures($cube);
$metamodel->registerCube($cube);
return $cube;
}