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


PHP ArrayHelper::search方法代码示例

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


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

示例1: prepareDatasetSequence


//.........这里部分代码省略.........
                $transitionalReferencePointIndexes4References[$reference->name] = $transitionalReferencePointIndexes4Reference;
            }
        }
        // we could use none of the selected references
        if (!isset($parentReferencePointIndex4References)) {
            return;
        }

        // removing all useless direct and indirect references if there is a direct way
        if (isset($directReferencePointColumnCount)) {
            foreach ($parentReferencePointIndex4References as $referenceName => $parentReferencePointIndex4Reference) {
                $referencePointColumnCount = count($parentReferencePointIndex4Reference);

                if (isset($directReferencePointIndex4References[$referenceName])) {
                    // we preserve only direct ways with maximum number of columns
                    if ($referencePointColumnCount == $directReferencePointColumnCount) {
                        continue;
                    }
                }
                else {
                    // we preserve only indirect ways with more columns than in direct way
                    if ($referencePointColumnCount > $directReferencePointColumnCount) {
                        continue;
                    }
                }

                unset($parentReferencePointIndex4References[$referenceName]);
                unset($directReferencePointIndex4References[$referenceName]);
                unset($transitionalReferencePointIndexes4References[$referenceName]);
            }
        }

        foreach ($parentReferencePointIndex4References as $referenceName => $parentReferencePointIndex4Reference) {
            $reference = $references[ArrayHelper::search($references, 'name', $referenceName)];

            $referencePointColumnCount = $reference->getPointColumnCount();

            $referencePointIndexes4Reference = isset($directReferencePointIndex4References[$referenceName])
                ? $directReferencePointIndex4References[$referenceName]
                : NULL;
            $isDirectReference = isset($referencePointIndexes4Reference);

            if (!$isDirectReference) {
                // 01/09/2014 reference can be reused only for direct references
                if (isset($callcontext->referenceNameStack[$referenceName])) {
                    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;
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:67,代码来源:ReferenceLinkBuilder.php

示例2: registerAjaxCssFile

 public function registerAjaxCssFile($sPath)
 {
     if (ArrayHelper::search($sPath, $this->aAjaxCssFiles) === false) {
         array_push($this->aAjaxCssFiles, $sPath);
         return true;
     }
     return false;
 }
开发者ID:ruxon,项目名称:framework,代码行数:8,代码来源:Client.class.php


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