public function populateOasis() { $oases = $this->WDataModel->getAllOases(); foreach ($oases as $oasis) { if ($oasis->oasistype < 4) { $high = 1; } elseif ($oasis->oasistype < 10) { $high = 2; } else { $high = 0; } $this->ODataModel->add(['wref' => $oasis->id, 'type' => $oasis->oasistype, 'wood' => 800, 'iron' => 800, 'clay' => 800, 'crop' => 800, 'maxstore' => 800, 'maxcrop' => 800, 'loyalty' => 100, 'owner' => App\FrontModule\Model\User\UserModel::NATURE_ID, 'name' => 'Unoccupied Oasis', 'high' => $high]); $this->saveOasisUnits($oasis->id, $oasis->oasistype); } }