Guest User

Untitled

a guest
Jul 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. class PluginProdutoTable extends Doctrine_Table
  4. {
  5. private function getForList(){
  6. $q = $this->createQuery('a')
  7. ->where('a.is_activated = ?', 1)
  8. ->innerJoin('a.Translation t WITH t.lang = ?', sfContext::getInstance()->getUser()->getCulture())
  9. ->orderBy('t.name');
  10. return $q;
  11. }
  12.  
  13. //....
  14. public function destaques(){
  15. $q = $this->getForList();
  16. $q->addWhere('a.destaque = ?', 1);
  17. return $q->execute();
  18. }
  19. }
Add Comment
Please, Sign In to add comment