objectManager = $objectManager; } /** * Get action class instance by class name * * @param string $className * @param [] $arguments * @throws \InvalidArgumentException * @return ActionInterface */ public function create($className, $arguments = []) { $action = $this->objectManager->create($className, $arguments); if (!$action instanceof ActionInterface) { throw new \InvalidArgumentException( $className . ' doesn\'t implement \Magento\Framework\Indexer\ActionInterface' ); } return $action; } }