Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################################################
- # Get all facilities in a county based on facility_id
- #####################################################
- public function executeRegionResults(sfWebRequest $request)
- {
- $c = new Criteria();
- $c->add(CountyPeer::NICE_TITLE, $request->getParameter('county_name'));
- $county = CountyPeer::doSelectOne($c);
- $c = new Criteria();
- $c->add(DistrictPeer::COUNTY_ID, $county->getId());
- $districts = DistrictPeer::doSelect($c);
- $ar_district_ids = array();
- foreach($districts as $district)
- $ar_district_ids[] = $district->getId();
- $c = new Criteria();
- $c->add(FacilityPeer::DISTRICT_ID, $ar_district_ids, Criteria::IN);
- $this->facilities = FacilityPeer::getPager ( $c, $request->getParameter ( 'page', 1 ), 15 );
- $pager = new sfPropelPager ( 'Facility', 15 );
- $pager->setCriteria ( $c );
- $pager->setPage ( $this->getRequestParameter ( 'page', 1 ) );
- $pager->init ();
- $this->pager = $pager;
- return sfView::SUCCESS;
- }
Add Comment
Please, Sign In to add comment