Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Account
  5. *
  6. * This class has been auto-generated by the Doctrine ORM Framework
  7. *
  8. * @package ##PACKAGE##
  9. * @subpackage ##SUBPACKAGE##
  10. * @author ##NAME## <##EMAIL##>
  11. * @version SVN: $Id: Builder.php 6401 2009-09-24 16:12:04Z guilhermeblanco $
  12. */
  13. class Account extends BaseAccount
  14. {
  15. public function pagination()
  16. {
  17. $query = $this->getTable()->createQuery()
  18. ->select('a.id, a.url, a.name, a.billing_address_postal, a.billing_address_city, a.phone_office, a.email, g.name')
  19. ->from('Account a')
  20. ->leftJoin('a.Account_Group AS g ON (a.group_id = g.id)')
  21. ->orderBy('a.name')
  22. ->getSql();
  23.  
  24. $pager = new Doctrine_Pager($query, 1, 25);
  25. $items = $pager->execute();
  26.  
  27. print_r($items); exit;
  28. }
  29.  
  30. public function findByUrl($url, array $order = array())
  31. {
  32. $results = $this->getTable()->createQuery()
  33. ->where('url = ?', $url)
  34. ->fetchOne();
  35.  
  36. return $results;
  37. }
  38.  
  39. public function findByName($name, array $order = array())
  40. {
  41. $results = $this->getTable()->createQuery()
  42. ->where('name = ?', $name)
  43. ->fetchOne();
  44.  
  45. return $results;
  46. }
  47. }
Add Comment
Please, Sign In to add comment