Data.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cron\Model\Groups\Config;
  7. use Magento\Framework\Serialize\SerializerInterface;
  8. /**
  9. * Provides cron groups configuration
  10. */
  11. class Data extends \Magento\Framework\Config\Data
  12. {
  13. /**
  14. * Constructor
  15. *
  16. * @param \Magento\Cron\Model\Groups\Config\Reader\Xml $reader
  17. * @param \Magento\Framework\Config\CacheInterface $cache
  18. * @param string|null $cacheId
  19. * @param SerializerInterface|null $serializer
  20. */
  21. public function __construct(
  22. \Magento\Cron\Model\Groups\Config\Reader\Xml $reader,
  23. \Magento\Framework\Config\CacheInterface $cache,
  24. $cacheId = 'cron_groups_config_cache',
  25. SerializerInterface $serializer = null
  26. ) {
  27. parent::__construct($reader, $cache, $cacheId, $serializer);
  28. }
  29. /**
  30. * Return config by group id
  31. *
  32. * @param string $groupId
  33. * @return array
  34. */
  35. public function getByGroupId($groupId)
  36. {
  37. return $this->get()[$groupId];
  38. }
  39. }