public function prepareQueryBeforeCount(xPDOQuery $c) { $c = parent::prepareQueryBeforeCount($c); $where = array(); if ($this->getProperty('parent')) { $c->where(array('parent' => $this->getProperty('parent'))); } if ($this->getProperty('where')) { $c->where((array) $this->getProperty('where')); } return $c; }
public function prepareQueryBeforeCount(xPDOQuery $c) { $c = parent::prepareQueryBeforeCount($c); $where = array(); $c->innerJoin('galAlbumItem', "AlbumItems"); $c->innerJoin('galAlbum', "Album", "AlbumItems.album = Album.id"); if ($album_id = (int) $this->getProperty('album_id')) { $where['Album.id'] = $album_id; } if ($where) { $c->where($where); } $c->select('AlbumItems.rank'); $c->sortBy('AlbumItems.rank', 'ASC'); return $c; }
public function prepareQueryBeforeCount(xPDOQuery $c) { $c = parent::prepareQueryBeforeCount($c); $c->leftJoin('ShopmodxProduct', 'Product'); $where = array(); if ($this->getProperty('listType') == 'products') { $where["Product.id:!="] = null; } else { $where["{$this->classKey}.parent"] = $this->getProperty('parent'); } if ($context_key = $this->getProperty('context_key')) { $where["{$this->classKey}.context_key"] = $this->getProperty('context_key'); } $c->where($where); return $c; }