Mam taki kod:
public function executeList(sfWebRequest $request) { $this->voivodship_id = $request->getParameter('id', 0); $this->pager = new sfPropelPager('Restaurant', sfConfig::get('app_max_restaurants_per_page')); $c = new Criteria(); if($this->voivodship_id > 0) { $c->add(CityPeer::VOIVODSHIP_ID, $this->voivodship_id); } //RestaurantPeer::doSelectJoinCity($c) $this->pager->setCriteria($c); $this->pager->setPeerMethod('doSelectJoinCity'); $this->pager->setPeerCountMethod('doCountJoinCity'); $this->pager->setPage($this->getRequestParameter('page', 1)); $this->pager->init(); }
Jak $this->voivodhship_id nie spełnia warunku w IF to zapytanie doSelectJoinCity jest wykonywane. Jak jest IF spełniony to doSelectJoinCity się nie wykonuje, jedynie doCountJoinCity. Dlaczego? Próbowałem coś ze zmianą kolejności itd ale coś nie pomogło.
pzdr.