当前位置: 首页>>代码示例>>PHP>>正文


PHP CategoryPeer::getAllSub方法代码示例

本文整理汇总了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;
 }
开发者ID:Chipusy,项目名称:lkbroker,代码行数:28,代码来源:actions.class.php

示例2: executeIndex

 public function executeIndex(sfWebRequest $request)
 {
     $this->parentCategory = CategoryPeer::getAllParent();
     $this->subCategory = CategoryPeer::getAllSub();
 }
开发者ID:Chipusy,项目名称:lkbroker,代码行数:5,代码来源:actions.class.php

示例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));
        ?>
开发者ID:Chipusy,项目名称:lkbroker,代码行数:31,代码来源:_list.php


注:本文中的CategoryPeer::getAllSub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。