/** * @param \DLigo\Animaltool\Domain\Model\Animal $animal * @Flow\IgnoreValidation (argumentName="$animal") * @return void */ public function treatmentAction(Animal $animal) { $this->response->setHeader('no-store', true); $this->response->setHeader('no-cache', true); $this->view->assign('healthConditions', $animal->getHealthConditions()); $this->view->assign('breads', $this->breadRepository->findBySpecies($animal->getSpecies())); $this->view->assign('colors', $this->colorRepository->findAll()); $this->view->assign('genders', $animal->getGenders()); $this->view->assign('doctors', $this->userRepository->findByRoles(array('DLigo.Animaltool:Doctor'))); $ts = $this->therapyRepository->findAll(); $therapies = array(); foreach ($ts as $t) { $therapies[$this->persistenceManager->getIdentifierByObject($t)] = $t; } $this->view->assign('therapies', $therapies); $this->view->assign('animal', $animal); }
/** * @return void */ public function newAction() { $sp = $this->speciesRepository->findAll(); $species = array(); foreach ($sp as $s) { $species[$this->persistenceManager->getIdentifierByObject($s)] = $s; $useTags[$this->persistenceManager->getIdentifierByObject($s)] = $s->getUseTag(); } $this->view->assign('species', $species); $this->view->assign('useTags', $useTags); $dummy = new \DLigo\Animaltool\Domain\Model\Animal(); $this->view->assign('therapyStatuses', $dummy->getTherapyStatuses()); $this->view->assign('stayStatuses', $dummy->getStayStatuses()); $this->view->assign('healthConditions', $dummy->getHealthConditions()); $this->view->assign('colors', $this->colorRepository->findAll()); $this->view->assign('genders', $dummy->getGenders()); $user = $this->session->getUser(); if ($this->session->getLocation() == null) { $this->view->assign('locations', $this->locationRepository->findAll()); } $boxid = $user->getTeamID() . '-' . ($user->getLastBoxID() + 1); $this->view->assign('boxid', $boxid); }