private function selectPosts() { switch ($this->http->router->group()) { case 'post': $this->query->setQuery('post'); break; case 'category': $catIdArray = RegistryFactory::start()->register('App\\Resource\\CategoryList')->child(); $this->query->setQuery('post')->categoryId($catIdArray)->force(); break; case 'date': $this->query->setQuery('post')->date($this->getDate())->force(); break; default: $this->query->setQuery('post'); } $this->post = $this->query->getQuery(); }
private function setPageFromDB() { $this->query->setQuery('page'); $this->page = $this->query->getQuery(); }
/** * todo do something with paginate() * @return array */ public function getResult() : array { return $this->query->getQuery(); }