Guest User

Untitled

a guest
Feb 6th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php
  2.  
  3. class Model extends Nette\Object
  4. {
  5. /** @var Nette\Database\Table\Selection */
  6. private $db;
  7.  
  8. public function __construct(DibiConnection $db)
  9. {
  10. $this->db = $db;
  11. }
  12.  
  13.  
  14.  
  15. public function getCars()
  16. {
  17. return $this->db
  18. ->select('*')
  19. ->from('nove_vozy');
  20. }
  21.  
  22. public function getCar($id = 0)
  23. {
  24. return $this->db
  25. ->select('*')
  26. ->from('nove_vozy')->where('id = %s', $id);
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment