![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/framework/Model/ResourceModel/Db/Relation/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\Model\ResourceModel\Db\Relation; use Magento\Framework\ObjectManagerInterface as ObjectManager; /** * Class ActionPool */ class ActionPool { /** * @var ObjectManager */ protected $objectManager; /** * @var array */ protected $relationActions; /** * @param ObjectManager $objectManager * @param array $relationActions */ public function __construct( ObjectManager $objectManager, array $relationActions = [] ) { $this->objectManager = $objectManager; $this->relationActions = $relationActions; } /** * @param string $entityType * @param string $actionName * @return object[] * @throws \Exception */ public function getActions($entityType, $actionName) { $actions = []; if (!isset($this->relationActions[$entityType][$actionName])) { return $actions; } foreach ($this->relationActions[$entityType][$actionName] as $actionClassName) { $action = $this->objectManager->get($actionClassName); $actions[] = $action; } return $actions; } }