Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. public function executeIndex(sfWebRequest $request)
  2. {
  3. $perpage = sfConfig::get('app_max_per_page', 20);
  4. $this->shopprods = new sfDoctrinePager('Cat', $perpage);
  5. $this->filterform = new shopprodFormFilter();
  6. if ($request->hasParameter($this->filterform->getName())
  7. {
  8. $this->filterform->bind($request->getParameter($this->filterform->getName()));
  9. $this->filterform->disableCSRFProtection();
  10. $query = $this->filterform->buildQuery($this->filterform->getValues());
  11. $this->shopprods->setQuery($query);
  12. $this->shopprods->getQuery();
  13. //preparing the variables to pass to the pag link
  14. $this->description = $request->getParameter($this->filterform->getName());
  15. $this->description = $this->description["description"]["text"];
  16. } else {
  17. if ($request->hasParameter("description")){
  18. $this->description = $request->getParameter("description");
  19. }
  20. $this->shopprods->setQuery(Doctrine::getTable('ShopCat')->createQuery('p')
  21. ->select()
  22. ->from('shopprod p')
  23. ->leftJoin('p.shopcat c ON c.id=p.shopcat_id')
  24. ->leftJoin('p.shopcoin m ON m.id=p.shopcoin_id')
  25. //->leftJoin('p.shopcoins')
  26. );
  27. }
  28. sfContext::getInstance()->getUser()->setFlash('notice', 'Mobilier import Germania. Magazin Outlet online mobilier si tablouri.');
  29.  
  30. $this->shopprods->setPage($request->getParameter('page', 1));
  31. $this->shopprods->init();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement