Collection.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Model\Rule\Action;
  7. class Collection extends \Magento\Rule\Model\Action\Collection
  8. {
  9. /**
  10. * @param \Magento\Framework\View\Asset\Repository $assetRepo
  11. * @param \Magento\Framework\View\LayoutInterface $layout
  12. * @param \Magento\Rule\Model\ActionFactory $actionFactory
  13. * @param array $data
  14. */
  15. public function __construct(
  16. \Magento\Framework\View\Asset\Repository $assetRepo,
  17. \Magento\Framework\View\LayoutInterface $layout,
  18. \Magento\Rule\Model\ActionFactory $actionFactory,
  19. array $data = []
  20. ) {
  21. parent::__construct($assetRepo, $layout, $actionFactory, $data);
  22. $this->setType(\Magento\SalesRule\Model\Rule\Action\Collection::class);
  23. }
  24. /**
  25. * @return array
  26. */
  27. public function getNewChildSelectOptions()
  28. {
  29. $actions = parent::getNewChildSelectOptions();
  30. $actions = array_merge_recursive(
  31. $actions,
  32. [['value' => \Magento\SalesRule\Model\Rule\Action\Product::class, 'label' => __('Update the Product')]]
  33. );
  34. return $actions;
  35. }
  36. }