public function init()
 {
     parent::init();
     $this->myCompany = R::findOne('company', 'user_id = ?', array($this->user->getID()));
     if (!$this->myCompany) {
         $this->error('Du besitzt keine Firma!');
     }
 }
    public function init()
    {
        parent::init();
        $this->myQuests = R::related($this->user, 'company_quest');
        if (!R::findOne('company', ' user_id = ?', array($this->user->id))) {
            $this->error('Du besitzt keine Firma. Geh ins Nachbargebäude und gründe dort
			eine Firma bevor du Aufträge annehmen kannst.');
        }
    }
 public function init()
 {
     parent::init();
     mt_srand((double) microtime(true) * 123456);
     $this->_myGame = R::findOne('blackjack', ' user_id = ?', array($this->user->getID()));
     if ($this->_myGame != null) {
         $this->_myCards = json_decode($this->_myGame->user_cards, true);
         $this->_dealerCards = json_decode($this->_myGame->dealer_cards, true);
     }
 }
    public function init()
    {
        parent::init();
        $this->myCompany = R::findOne('company', ' user_id = ?', array($this->user->id));
        $this->myRess = R::findOne('company_ress', ' company_id = ?', array($this->myCompany->id));
        $this->myProducts = R::findOne('company_products', ' company_id = ?', array($this->myCompany->id));
        if (!$this->myCompany) {
            $this->error('Du besitzt keine Firma und kannst deshalb auch nicht handeln!
			Geh is Nachbargebäude und gründe dort eine Firma.');
        }
    }
 public function init()
 {
     parent::init();
     $this->account = R::findOne('bank_account', ' user_id = ?', array($this->user->getID()));
     if (!$this->account) {
         // create account
         $this->account = R::dispense('bank_account');
         $this->account->user = $this->user;
         $this->account->balance = 0;
         $this->account->lastCalc = time();
         R::store($this->account);
     }
 }