本文整理汇总了PHP中PageList::filterByPageTypeID方法的典型用法代码示例。如果您正苦于以下问题:PHP PageList::filterByPageTypeID方法的具体用法?PHP PageList::filterByPageTypeID怎么用?PHP PageList::filterByPageTypeID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageList
的用法示例。
在下文中一共展示了PageList::filterByPageTypeID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGatheringItems
public function createGatheringItems(GatheringDataSourceConfiguration $configuration)
{
$pl = new PageList();
$pl->ignoreAliases();
$pl->ignorePermissions();
$gathering = $configuration->getGatheringObject();
if ($gathering->getGatheringDateLastUpdated()) {
$pl->filterByPublicDate($gathering->getGatheringDateLastUpdated(), '>');
}
$ptID = $configuration->getPageTypeID();
if ($ptID > 0) {
$pl->filterByPageTypeID($ptID);
}
$pages = $pl->get();
$items = array();
foreach ($pages as $c) {
$item = PageGatheringItem::add($configuration, $c);
if (is_object($item)) {
$items[] = $item;
}
}
return $items;
}
示例2: array
if (is_object($target)) {
$cParentID = $target->getCollectionID();
}
if (is_object($pagetype) && $pagetype->getPageTypePublishTargetTypeID() == $configuration->getPageTypePublishTargetTypeID()) {
$configuredTarget = $pagetype->getPageTypePublishTargetObject();
if ($configuredTarget->getSelectorFormFactor() == 'sitemap_in_page') {
$siteMapParentID = HOME_CID;
if ($configuredTarget->getStartingPointPageID()) {
$siteMapParentID = $configuredTarget->getStartingPointPageID();
}
$ps = Loader::helper('form/page_selector');
print $ps->selectFromSitemap('cParentID', $cParentID, $siteMapParentID, array('ptID' => $configuredTarget->getPageTypeID()));
} else {
$pl = new PageList();
$pl->sortByName();
$pl->filterByPageTypeID($configuredTarget->getPageTypeID());
$pl->sortByName();
$pages = $pl->get();
if (count($pages) > 1) {
$options = array();
foreach ($pages as $p) {
$options[$p->getCollectionID()] = $p->getCollectionName();
}
print $form->select('cParentID', $options, $cParentID);
} else {
if (count($pages) == 1) {
$p = $pages[0];
print $form->hidden('cParentID', $p->getCollectionID());
print t('This page will be published beneath "%s."', $p->getCollectionName());
}
}