/** * @param string $exportPath * @return $this */ public function init($exportPath) { $this->setExportPath($exportPath); UtilityService::createDir($this->getDataDirPath(), $this->userGroup); $this->getPrefs(); return $this; }
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); }
/** * @param array $datas * @param string $exportPath * @param string $userGroup */ public function __construct($datas, $exportPath, $userGroup) { $this->datas = $datas; $this->exportPath = $exportPath; $this->userGroup = $userGroup; UtilityService::createDir($exportPath, $userGroup); foreach ($this->entitiesName as $className) { $entityExporterConstructor = '\\AppBundle\\Business\\Exporter\\Entity\\' . ucfirst($className) . 'Exporter'; /* @var $entityExporter \AppBundle\Business\Exporter\Entity\AbstractEntityExporter */ $this->arrayEntityExport[$className] = new $entityExporterConstructor(); } }
/** * @return string */ public function getCollectionPath() { $institutionPath = $this->getPath() . '/' . $this->collection->getInstitution()->getInstitutioncode() . '/'; UtilityService::createDir($institutionPath, $this->userGroup); $collectionPath = $institutionPath . $this->collection->getCollectioncode(); return UtilityService::createDir($collectionPath, $this->userGroup); }