Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Account
- *
- * This class has been auto-generated by the Doctrine ORM Framework
- *
- * @package ##PACKAGE##
- * @subpackage ##SUBPACKAGE##
- * @author ##NAME## <##EMAIL##>
- * @version SVN: $Id: Builder.php 6401 2009-09-24 16:12:04Z guilhermeblanco $
- */
- class Account extends BaseAccount
- {
- public function pagination()
- {
- $query = $this->getTable()->createQuery()
- ->select('a.id, a.url, a.name, a.billing_address_postal, a.billing_address_city, a.phone_office, a.email, g.name')
- ->from('Account a')
- ->leftJoin('a.Account_Group AS g ON (a.group_id = g.id)')
- ->orderBy('a.name')
- ->getSql();
- $pager = new Doctrine_Pager($query, 1, 25);
- $items = $pager->execute();
- print_r($items); exit;
- }
- public function findByUrl($url, array $order = array())
- {
- $results = $this->getTable()->createQuery()
- ->where('url = ?', $url)
- ->fetchOne();
- return $results;
- }
- public function findByName($name, array $order = array())
- {
- $results = $this->getTable()->createQuery()
- ->where('name = ?', $name)
- ->fetchOne();
- return $results;
- }
- }
Add Comment
Please, Sign In to add comment