original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Creates the payment images folder.
  
  @return Folder
docstring_tokens: Creates the payment images folder .