本文整理汇总了PHP中Section::getDisplayCriteria方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::getDisplayCriteria方法的具体用法?PHP Section::getDisplayCriteria怎么用?PHP Section::getDisplayCriteria使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::getDisplayCriteria方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCriteria
function getCriteria()
{
$total_crit = array();
$article_search = new Article($this->dbcon);
if ($crit = $this->getData('sqlwhere')) {
if ($bad_spot = strpos($crit, "or typeid")) {
$crit = substr($crit, 0, $bad_spot) . ")";
}
$total_crit[] = $crit;
}
if ($id = $this->getData('class_id')) {
#$total_crit[] = "class =".$id;
$total_crit[] = $article_search->makeCriteriaClass($id);
}
if ($id = $this->getData('section_id')) {
$section = new Section($this->dbcon, $id);
$section_crit = $section->getDisplayCriteria();
$crit = join(' AND ', $article_search->makeCriteria($section_crit));
$total_crit[] = $crit;
}
if (empty($total_crit)) {
return $article_search->makeCriteriaDisplayable();
}
return "( " . join(" " . $this->getCombineLogic() . " ", $total_crit) . " ) AND " . $article_search->makeCriteriaDisplayable();
}
示例2: makeCriteriaSectionLogic
function makeCriteriaSectionLogic($section_id)
{
require_once 'AMP/Content/Section.inc.php';
$section = new Section(AMP_Registry::getDbcon(), $section_id);
if (!$section->hasData()) {
return 'TRUE';
}
$scope = $section->getDisplayCriteria();
unset($scope['displayable']);
$value = $this->makeCriteria($scope);
if ($value) {
return join(' AND ', $value);
}
return 'TRUE';
}