Advertisement
vanchelo

Untitled

Oct 9th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Get a list of Categories
  4.  *
  5.  * @package miniShop
  6.  * @subpackage processors
  7.  */
  8. class GoodsGetListProcessor extends CatsGetListProcessor {
  9.     public $classKey = 'modResource';
  10.     public $languageTopics = array('resource');
  11.     public $defaultSortField = 'pagetitle';
  12.  
  13.     public function prepareQueryBeforeCount(xPDOQuery $c) {
  14.         $query = $this->getProperty('query');
  15.     $c->select(array('modResource.id','modResource.pagetitle'));
  16.         $c->where(array(
  17.             'isfolder' => 1,
  18.             'template' => 13,
  19.             'deleted' => 0,
  20.             'published' => 1
  21.             ));
  22.         if (!empty($query)) {
  23.             $c->where(array(
  24.                 'pagetitle:LIKE' => $query.'%'
  25.             ));
  26.         }
  27.         return $c;
  28.     }
  29. }
  30. return 'CatsGetListProcessor';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement