Install/PaymentInstaller.php
private function createImageFolder()
    {
        $em = $this->container->get('ekyna_payment.method.manager');
        $folderRepository = $this->container->get('ekyna_media.folder.repository');

        if (null === $rootFolder = $folderRepository->findRoot()) {
            throw new \RuntimeException('Can\'t find root folder. Please run MediaBundle installer first.');
        }

        $name = 'Payment method';

        $paymentFolder = $folderRepository->findOneBy([
            'name' => $name,
            'parent' => $rootFolder,
        ]);
        if (null !== $paymentFolder) {
            return $paymentFolder;
        }

        $paymentFolder = new Folder();
        $paymentFolder
            ->setName($name)
            ->setParent($rootFolder)
        ;

        $em->persist($paymentFolder);
        $em->flush();

        return $paymentFolder;
    }
private function createImageFolder()
    {
        $em = $this->container->get('ekyna_payment.method.manager');
        $folderRepository = $this->container->get('ekyna_media.folder.repository');

        if (null === $rootFolder = $folderRepository->findRoot()) {
            throw new \RuntimeException('Can\'t find root folder. Please run MediaBundle installer first.');
        }

        $name = 'Payment method';

        $paymentFolder = $folderRepository->findOneBy([
            'name' => $name,
            'parent' => $rootFolder,
        ]);
        if (null !== $paymentFolder) {
            return $paymentFolder;
        }

        $paymentFolder = new Folder();
        $paymentFolder
            ->setName($name)
            ->setParent($rootFolder)
        ;

        $em->persist($paymentFolder);
        $em->flush();

        return $paymentFolder;
    }
private function createImageFolder ( ) { $ em = $ this -> container -> get ( 'ekyna_payment.method.manager' ) ; $ folderRepository = $ this -> container -> get ( 'ekyna_media.folder.repository' ) ; if ( null === $ rootFolder = $ folderRepository -> findRoot ( ) ) { throw new \ RuntimeException ( 'Can\'t find root folder. Please run MediaBundle installer first.' ) ; } $ name = 'Payment method' ; $ paymentFolder = $ folderRepository -> findOneBy ( [ 'name' => $ name , 'parent' => $ rootFolder , ] ) ; if ( null !== $ paymentFolder ) { return $ paymentFolder ; } $ paymentFolder = new Folder ( ) ; $ paymentFolder -> setName ( $ name ) -> setParent ( $ rootFolder ) ; $ em -> persist ( $ paymentFolder ) ; $ em -> flush ( ) ; return $ paymentFolder ; }
Creates the payment images folder.

@return Folder
Creates the payment images folder .