本文整理汇总了PHP中ListboxField::getSource方法的典型用法代码示例。如果您正苦于以下问题:PHP ListboxField::getSource方法的具体用法?PHP ListboxField::getSource怎么用?PHP ListboxField::getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListboxField
的用法示例。
在下文中一共展示了ListboxField::getSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSource
/**
*
* @return Array
*/
function getSource()
{
$source = parent::getSource();
//debug::log("original source count ".implode($this->classNamesForItems)." ".$this->siteTreeParentID.": ".count($source));
if ($this->siteTreeParentID) {
$arrayItems = array();
$allChildrenForSiteTreeParent = $this->getAllChildrenForSiteTreeParent($this->siteTreeParentID);
//debug::log("new source count: ".count($allChildrenForSiteTreeParent));
$finalSource = array();
foreach ($source as $sourceKey => $sourceValue) {
if (isset($allChildrenForSiteTreeParent[$sourceKey])) {
$finalSource[$sourceKey] = $sourceValue;
}
}
} else {
$finalSource = $source;
}
//debug::log("final source count: ".count($finalSource));
return $finalSource;
}
示例2: getSource
public function getSource()
{
$source = parent::getSource();
if ($this->tags) {
$values = array_values($source);
$source = array_combine($values, $values);
}
return $source;
}