HosipLan

Untitled

Oct 5th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. //config.neon
  2.     services:
  3.         Users: Users(@database)
  4.  
  5. //Users.php
  6. <?php
  7.  
  8. use Nette\Application\UI;
  9. use Nette\Security as NS;
  10.  
  11. class Users
  12. {
  13.     private $db;
  14.  
  15.     public function __construct(Nette\Database\Connection $db)
  16.     {
  17.         $this->db = $db;
  18.     }
  19.  
  20.     public function activeCompany($id)
  21.     {
  22.         return $this->db->table('users')->where('id=?',$id)->fetch()->company_id;
  23.     }
  24.    
  25. }
Advertisement
Add Comment
Please, Sign In to add comment