/** * action index. */ public function indexAction() { $this->createDirectoryStructure(); $this->removePreviousExports(); $exportFile = PATH_site . $this->exportPath . $this->exportFile; $fp = fopen($exportFile, 'w'); foreach ($this->clubRepository->findAllForExport() as $row) { fputcsv($fp, $row, ';', '\''); } fclose($fp); }
/** * This is a workaround to help controller actions to find (hidden) posts. * * @param $argumentName */ protected function registerClubFromRequest($argumentName) { $argument = $this->request->getArgument($argumentName); if (is_array($argument)) { // get club from form ($_POST) $club = $this->clubRepository->findHiddenEntryByUid($argument['__identity']); } elseif (is_object($argument)) { // get club from domain model $club = $argument; } else { // get club from UID $club = $this->clubRepository->findHiddenEntryByUid($argument); } $this->session->registerObject($club, $club->getUid()); }