Advertisement
Guest User

Untitled

a guest
Feb 15th, 2011
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. /*
  2. ---------       ----------
  3. | Books |       | Author |
  4. ---------       ----------
  5. | id    |   --->| id     |
  6. | name  |   |   | name   |
  7. | a_id  |----   |        |
  8. ---------       ----------
  9. */
  10.  
  11. //Model_Books.php
  12. public function fetchAll()
  13. {
  14.     $select = $this->select()->setIntegrityCheck(false);
  15.     $select->from($this->_name, array(/.. your columns from books/))
  16.            ->joinInner('books', 'condition', array('your columns'); //or you can use $this->_referenceMap
  17.            
  18.     return parent::fetchAll($select);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement