public function prepareQueryBeforeCount(xPDOQuery $c) { $c = parent::prepareQueryBeforeCount($c); $where = array('deleted' => false); if (!$this->getProperty('showhidden', false)) { $where['hidemenu'] = 0; } if (!$this->getProperty('showunpublished', false)) { $where['published'] = 1; } if ($parent = (int) $this->getProperty('parent')) { $where["parent"] = $parent; } $c->where($where); return $c; }