/** * Return hash of image adapter codes and labels * * @return array */ public function toOptionArray() { $result = []; foreach ($this->config->getAdapters() as $alias => $adapter) { $result[$alias] = __($adapter['title']); } return $result; }
/** * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param Adapter\ConfigInterface $config * @param array $adapterMap */ public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\Image\Adapter\ConfigInterface $config, array $adapterMap = []) { $this->objectManager = $objectManager; $this->config = $config; $this->adapterMap = array_merge($config->getAdapters(), $adapterMap); }