MassAction.php 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Ui\Component;
  7. /**
  8. * @api
  9. * @since 100.0.2
  10. */
  11. class MassAction extends AbstractComponent
  12. {
  13. const NAME = 'massaction';
  14. /**
  15. * @inheritDoc
  16. */
  17. public function prepare()
  18. {
  19. $config = $this->getConfiguration();
  20. foreach ($this->getChildComponents() as $actionComponent) {
  21. $config['actions'][] = $actionComponent->getConfiguration();
  22. }
  23. $origConfig = $this->getConfiguration();
  24. if ($origConfig !== $config) {
  25. $config = array_replace_recursive($config, $origConfig);
  26. }
  27. $this->setData('config', $config);
  28. $this->components = [];
  29. parent::prepare();
  30. }
  31. /**
  32. * Get component name
  33. *
  34. * @return string
  35. */
  36. public function getComponentName()
  37. {
  38. return static::NAME;
  39. }
  40. }