RegisterThemes.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Theme\Setup\Patch\Data;
  7. use Magento\Theme\Model\Theme\Registration;
  8. use Magento\Framework\App\ResourceConnection;
  9. use Magento\Framework\Setup\Patch\DataPatchInterface;
  10. use Magento\Framework\Setup\Patch\PatchVersionInterface;
  11. /**
  12. * Class RegisterThemes
  13. * @package Magento\Theme\Setup\Patch
  14. */
  15. class RegisterThemes implements DataPatchInterface, PatchVersionInterface
  16. {
  17. /**
  18. * @var \Magento\Framework\Setup\ModuleDataSetupInterface
  19. */
  20. private $moduleDataSetup;
  21. /**
  22. * @var Registration
  23. */
  24. private $themeRegistration;
  25. /**
  26. * RegisterThemes constructor.
  27. * @param \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
  28. * @param Registration $themeRegistration
  29. */
  30. public function __construct(
  31. \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup,
  32. Registration $themeRegistration
  33. ) {
  34. $this->moduleDataSetup = $moduleDataSetup;
  35. $this->themeRegistration = $themeRegistration;
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public function apply()
  41. {
  42. $this->themeRegistration->register();
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public static function getDependencies()
  48. {
  49. return [];
  50. }
  51. /**
  52. * {@inheritdoc}
  53. */
  54. public static function getVersion()
  55. {
  56. return '2.0.0';
  57. }
  58. /**
  59. * {@inheritdoc}
  60. */
  61. public function getAliases()
  62. {
  63. return [];
  64. }
  65. }