/** * @param string $username * @return User */ public function loadUserByUsername($username) { if ($username) { $user = new User($username, $this->apiRecolnatBaseUri, $this->apiRecolnatUserPath, $this->userGroup); $user->init($this->exportPath); return $user; } throw new UsernameNotFoundException(sprintf('Username "%s" does not exist.', $username)); }
protected function execute(InputInterface $input, OutputInterface $output) { /** @var User $user */ $user = new User('tpateffoz', [], $this->getContainer()->getParameter('api_recolnat_user'), $this->getContainer()->getParameter('user_group')); $user->init($this->getContainer()->getParameter('export_path')); $testDir = $user->getDataDirPath() . 'test/'; $testFile = $testDir . 'test.txt'; $userGroup = $this->getContainer()->getParameter('user_group'); UtilityService::createDir($testDir, $userGroup); UtilityService::createFile($testFile, $userGroup); $output->writeln($testDir); }