public function renderStable() { $this->units = $this->unitService->getAvailableUnits($this->village, App\GameModule\Model\Building\BuildingModel::STABLE); $this->template->units = $this->units; $this->template->available = $this->unitService->getTrainableUnits($this->village, $this->units); $this->template->current = $this->unitService->getUnits($this->village); $queue = $this->trainingModel->getByBuilding($this->village, App\GameModule\Model\Building\BuildingModel::STABLE); foreach ($queue as $item) { $item->unit = $this->unitFactory->getUnit($item->unit); } $this->template->queue = $queue; $this->template->setFile(__DIR__ . '/Template/Stable.latte'); }