本文整理汇总了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;
示例2: registerAjaxCssFile
public function registerAjaxCssFile($sPath)
{
if (ArrayHelper::search($sPath, $this->aAjaxCssFiles) === false) {
array_push($this->aAjaxCssFiles, $sPath);
return true;
}
return false;
}