vendor/sulu/sulu/src/Sulu/Bundle/MediaBundle/SuluMediaBundle.php line 27

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Sulu.
  4. *
  5. * (c) Sulu GmbH
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Sulu\Bundle\MediaBundle;
  11. use Sulu\Bundle\MediaBundle\DependencyInjection\FormatCacheClearerCompilerPass;
  12. use Sulu\Bundle\MediaBundle\DependencyInjection\ImageFormatCompilerPass;
  13. use Sulu\Bundle\MediaBundle\DependencyInjection\ImageTransformationCompilerPass;
  14. use Sulu\Bundle\MediaBundle\DependencyInjection\S3ClientCompilerPass;
  15. use Sulu\Bundle\MediaBundle\Entity\CollectionInterface;
  16. use Sulu\Bundle\MediaBundle\Entity\MediaInterface;
  17. use Sulu\Bundle\PersistenceBundle\PersistenceBundleTrait;
  18. use Symfony\Component\DependencyInjection\ContainerBuilder;
  19. use Symfony\Component\HttpKernel\Bundle\Bundle;
  20. /**
  21. * @final
  22. */
  23. class SuluMediaBundle extends Bundle
  24. {
  25. use PersistenceBundleTrait;
  26. /**
  27. * @internal
  28. */
  29. public function build(ContainerBuilder $container): void
  30. {
  31. $this->buildPersistence(
  32. [
  33. MediaInterface::class => 'sulu.model.media.class',
  34. CollectionInterface::class => 'sulu.model.collection.class',
  35. ],
  36. $container
  37. );
  38. $container->addCompilerPass(new FormatCacheClearerCompilerPass());
  39. $container->addCompilerPass(new ImageFormatCompilerPass());
  40. $container->addCompilerPass(new ImageTransformationCompilerPass());
  41. $container->addCompilerPass(new S3ClientCompilerPass());
  42. parent::build($container);
  43. }
  44. }