/** * Teleports the input IMappable to the input City * * @param IMappable $mappable * @param City $city */ public function teleportCity(IMappable $mappable, City $city) { $query = 'UPDATE ' . $this->getClass($mappable) . ' SET x=' . $city->getX() . ' WHERE id=' . $mappable->getId() . ';'; $this->db->setQuery($query); $this->db->query(); $query = 'UPDATE ' . $this->getClass($mappable) . ' SET y=' . $city->getY() . ' WHERE id=' . $mappable->getId() . ';'; $this->db->setQuery($query); $this->db->query(); }