/** * @param City $city * @return array */ public function getClansByCity(City $city) { $query = "SELECT * FROM game.clan WHERE city=" . $city->getId() . ';'; $this->db->setQuery($query); $this->db->query(); $objList = $this->db->loadObjectList(); $clans = null; foreach ($objList as $obj) { $clan = new Clan($obj->id); $clan->setDb($this->db); $clan->load(); $clans[] = $clan; } return $clans; }
/** * @param Clan $clan * @param City $city * @return mixed */ public function clanBuyBehavior(Clan $clan, City $city) { $request = $this->rules->createRequest($clan, 'buy goods', $city->getId() . ',1,25'); $result = $this->rules->submit($request); return $result['Description']; }