本文整理汇总了PHP中CategoryPeer::getAllSub方法的典型用法代码示例。如果您正苦于以下问题:PHP CategoryPeer::getAllSub方法的具体用法?PHP CategoryPeer::getAllSub怎么用?PHP CategoryPeer::getAllSub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CategoryPeer
的用法示例。
在下文中一共展示了CategoryPeer::getAllSub方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeView
public function executeView(sfWebRequest $request)
{
$category = CategoryPeer::retrieveByName($request->getParameter('category_name'));
$this->forward404Unless($category);
if ($category->getParentId() != 0) {
$this->parentCategory = CategoryPeer::retrieveByPk($category->getParentId());
} else {
$this->subCategorys = CategoryPeer::getAllSub($category->getId());
}
$c = new Criteria();
if (isset($this->subCategorys)) {
$subCategoryIds = array();
foreach ($this->subCategorys[$category->getId()] as $sub) {
$subCategoryIds[] = $sub->getId();
}
$subCategoryIds[] = $category->getId();
$c->add(ElementPeer::CATEGORY_ID, $subCategoryIds, Criteria::IN);
} else {
$c->add(ElementPeer::CATEGORY_ID, $category->getId());
}
$this->pager = new sfPropelPager('Element', 10);
$this->pager->setPeerMethod('doSelectJoinAll');
$this->pager->setCriteria($c);
$this->pager->setPage($this->getRequestParameter('page'), 1);
$this->pager->init();
$this->elements = $this->pager->getResults();
$this->category = $category;
}
示例2: executeIndex
public function executeIndex(sfWebRequest $request)
{
$this->parentCategory = CategoryPeer::getAllParent();
$this->subCategory = CategoryPeer::getAllSub();
}
示例3: __
?>
<?php
if ($pager->haveToPaginate()) {
?>
<?php
echo __('(page %%page%%/%%nb_pages%%)', array('%%page%%' => $pager->getPage(), '%%nb_pages%%' => $pager->getLastPage()), 'sf_admin');
?>
<?php
}
?>
</th>
</tr>
</tfoot>
<tbody>
<?php
$categorys = CategoryPeer::getAllSub();
?>
<?php
foreach ($pager->getResults() as $i => $Category) {
$odd = fmod(++$i, 2) ? 'odd' : 'even';
?>
<tr class="sf_admin_row <?php
echo $odd;
?>
">
<?php
include_partial('category/list_td_stacked', array('Category' => $Category));
?>
<?php
include_partial('category/list_td_actions', array('Category' => $Category, 'helper' => $helper));
?>