本文整理汇总了PHP中ArrayHelper::mergeArrays方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayHelper::mergeArrays方法的具体用法?PHP ArrayHelper::mergeArrays怎么用?PHP ArrayHelper::mergeArrays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayHelper
的用法示例。
在下文中一共展示了ArrayHelper::mergeArrays方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assemble
public function assemble(AbstractSQLDataSourceQueryHandler $datasourceHandler, DataControllerCallContext $callcontext, DatasetMetaData $dataset, array $columnNames = NULL)
{
$statement = new Statement();
$requestedColumnNames = self::prepareRequestedColumnNames($columnNames);
ArrayHelper::mergeArrays($statement->tables, self::prepareTableSections4Statement($datasourceHandler, $callcontext, $requestedColumnNames, TRUE));
return $statement;
}
示例2: initiateHandler
public function initiateHandler($operatorName)
{
$values = func_get_args();
array_shift($values);
$handlerConfiguration = $this->getHandlerConfiguration($operatorName);
$classname = $handlerConfiguration['handler']['classname'];
$handlerClass = new ReflectionClass($classname);
$params = NULL;
// first parameter is the operator configuration
$operatorMetaData = $this->getOperatorMetaData($operatorName);
$params[] = $operatorMetaData;
// next are parameters which represent values
if (count($values) === 1 && is_array($values[0])) {
$parameterCount = count($values[0]);
$expectedMinimumParameterCount = isset($operatorMetaData) ? $operatorMetaData->getRequiredParameterCount() : 0;
$expectedTotalParameterCount = isset($operatorMetaData) ? $operatorMetaData->getParameterCount() : 0;
if ($parameterCount == $expectedTotalParameterCount) {
ArrayHelper::mergeArrays($params, $values[0]);
} elseif ($expectedTotalParameterCount === 1) {
$params[] = $values[0];
} elseif ($parameterCount < $expectedTotalParameterCount && $parameterCount >= $expectedMinimumParameterCount) {
// we have some optional parameters which do not need to be provided
ArrayHelper::mergeArrays($params, $values[0]);
} else {
throw new IllegalArgumentException(t("Inconsistent number of arguments for '@name' operator", array('@name' => $operatorName)));
}
} else {
ArrayHelper::mergeArrays($params, $values);
}
return $handlerClass->newInstanceArgs($params);
}
示例3: merge
public function merge(Statement $statement)
{
ArrayHelper::mergeArrays($this->tables, $statement->tables);
ArrayHelper::mergeArrays($this->conditions, $statement->conditions);
ArrayHelper::mergeArrays($this->groupByColumns, $statement->groupByColumns);
ArrayHelper::mergeArrays($this->havingConditions, $statement->havingConditions);
}
示例4: mergeQueryValues
protected function mergeQueryValues(&$parameters, $request) {
$this->checkRequestQuery($request);
if (isset($request->queries)) {
$query = $request->queries[0];
ArrayHelper::mergeArrays($parameters, $query);
}
}
示例5: log
public function log($level, &$message)
{
if ($message instanceof StatementLogMessage) {
$statementLogMessage = $message;
if (is_array($statementLogMessage->statement)) {
ArrayHelper::mergeArrays(self::$statements, $statementLogMessage->statement);
} else {
self::$statements[$statementLogMessage->type][] = $statementLogMessage->statement;
}
}
}
示例6: getHandler
public function getHandler($type)
{
if (isset($this->handlerInstances[$type])) {
return $this->handlerInstances[$type];
}
$handlerConfiguration = $this->getHandlerConfiguration($type);
$extensionConfiguration = $this->getExtensionConfiguration($type);
$combinedExtensionConfigurations = NULL;
// adding generic configuration
ArrayHelper::mergeArrays($combinedExtensionConfigurations, $extensionConfiguration['extensions']);
// adding handler specific configurations
if (isset($handlerConfiguration['extensions'])) {
ArrayHelper::mergeArrays($combinedExtensionConfigurations, $handlerConfiguration['extensions']);
unset($handlerConfiguration['extensions']);
}
$classname = $handlerConfiguration['handler'];
$handler = new $classname($type, $combinedExtensionConfigurations);
$this->handlerInstances[$type] = $handler;
return $handler;
}
示例7: assemble
public function assemble(AbstractSQLDataSourceQueryHandler $datasourceHandler, DataControllerCallContext $callcontext, DatasetMetaData $dataset, array $columnNames = NULL)
{
$statement = new Statement();
$requestedColumnNames = self::prepareRequestedColumnNames($columnNames);
$tableDates = self::prepareTableSection($datasourceHandler, $callcontext, $requestedColumnNames);
$statement->tables[] = $tableDates;
$tableDayOfWeek = self::prepareDefTableSection($datasourceHandler, $callcontext, $requestedColumnNames);
$isDayOfWeekRequired = isset($tableDayOfWeek->columns);
$monthTableSections = DateDimensionMonthDatasetAssembler::prepareTableSections4Statement($datasourceHandler, $callcontext, $requestedColumnNames, FALSE);
$isMonthRequired = isset($monthTableSections);
if ($isDayOfWeekRequired) {
$tableDayOfWeek->conditions[] = new JoinConditionSection('day_of_week_def_id', new TableColumnConditionSectionValue(self::$TABLE_ALIAS_SUFFIX__DATES, 'day_of_week_def_id'));
$statement->tables[] = $tableDayOfWeek;
}
if ($isMonthRequired) {
$tableMonths = $monthTableSections[0];
$tableMonths->conditions[] = new JoinConditionSection('month_id', new TableColumnConditionSectionValue(self::$TABLE_ALIAS_SUFFIX__DATES, 'month_id'));
ArrayHelper::mergeArrays($statement->tables, $monthTableSections);
}
return $statement;
}
示例8: combineFrom
public function combineFrom(ReferenceRoute $route)
{
ArrayHelper::mergeArrays($this->segmentLinkIds, $route->segmentLinkIds);
$this->weight += $route->weight;
}