本文整理汇总了PHP中PageManager::fetchAllPagesPageTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP PageManager::fetchAllPagesPageTypes方法的具体用法?PHP PageManager::fetchAllPagesPageTypes怎么用?PHP PageManager::fetchAllPagesPageTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageManager
的用法示例。
在下文中一共展示了PageManager::fetchAllPagesPageTypes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute(&$param_pool)
{
$result = new XMLElement($this->dsParamROOTELEMENT);
$type_sql = $parent_sql = null;
if (trim($this->dsParamFILTERS['type']) != '') {
$type_sql = $this->__processNavigationTypeFilter($this->dsParamFILTERS['type'], $this->__determineFilterType($this->dsParamFILTERS['type']));
}
if (trim($this->dsParamFILTERS['parent']) != '') {
$parent_sql = $this->__processNavigationParentFilter($this->dsParamFILTERS['parent']);
}
// Build the Query appending the Parent and/or Type WHERE clauses
$pages = Symphony::Database()->fetch(sprintf("\n\t\t\t\t\tSELECT DISTINCT p.id, p.title, p.handle, (SELECT COUNT(id) FROM `tbl_pages` WHERE parent = p.id) AS children\n\t\t\t\t\tFROM `tbl_pages` AS p\n\t\t\t\t\tLEFT JOIN `tbl_pages_types` AS pt ON (p.id = pt.page_id)\n\t\t\t\t\tWHERE 1 = 1\n\t\t\t\t\t%s\n\t\t\t\t\t%s\n\t\t\t\t\tORDER BY p.`sortorder` ASC\n\t\t\t\t", !is_null($parent_sql) ? $parent_sql : " AND p.parent IS NULL ", !is_null($type_sql) ? $type_sql : ""));
if (!is_array($pages) || empty($pages)) {
if ($this->dsParamREDIRECTONEMPTY == 'yes') {
throw new FrontendPageNotFoundException();
}
$result->appendChild($this->__noRecordsFound());
} else {
// Build an array of all the types so that the page's don't have to do
// individual lookups.
$page_types = PageManager::fetchAllPagesPageTypes();
foreach ($pages as $page) {
$result->appendChild($this->__buildPageXML($page, $page_types));
}
}
return $result;
}