Advertisement
vanchelo

Untitled

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