Collection.php 1.3 KB

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