|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / app / Firebear / ImportExport / Ui / Component / Form / |
Filename | /home/a/home/dev2.destoffenstraat.com/app/Firebear/ImportExport/Ui/Component/Form/ExportField.php |
Size | 1.81 kb |
Permission | rw-rw-r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 07-Nov-2022 06:44 |
Last accessed | 23-Aug-2025 21:15 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/**
* Field
*
* @copyright Copyright © 2019 Firebear Studio. All rights reserved.
* @author Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Ui\Component\Form;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
/**
* Class Field
* @package Firebear\ImportExport\Ui\Component\Form
*/
class ExportField extends \Magento\Ui\Component\Form\Field
{
/**
* @var \Firebear\ImportExport\Model\Source\Import\Config
*/
protected $config;
/**
* Field constructor.
*
* @param ContextInterface $context
* @param UiComponentFactory $uiComponentFactory
* @param \Firebear\ImportExport\Model\Source\Import\Config $config
* @param array $components
* @param array $data
*/
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
\Firebear\ImportExport\Model\Source\Import\Config $config,
$components = [],
array $data = []
) {
parent::__construct($context, $uiComponentFactory, $components, $data);
$this->config = $config;
}
/**
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function prepare()
{
$entities = [];
foreach ($this->config->getEntities() as $key => $entity) {
$entities[$key] = $entity['name'];
}
if ($config = $this->getDataByKey('config')) {
if (isset($config['valuesForOptions'])) {
$config['valuesForOptions'] = \array_merge($config['valuesForOptions'], $entities);
} else {
$config['valuesForOptions'] = $entities;
}
$this->setData('config', $config);
}
parent::prepare();
}
}
/**
* Field
*
* @copyright Copyright © 2019 Firebear Studio. All rights reserved.
* @author Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Ui\Component\Form;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentFactory;
/**
* Class Field
* @package Firebear\ImportExport\Ui\Component\Form
*/
class ExportField extends \Magento\Ui\Component\Form\Field
{
/**
* @var \Firebear\ImportExport\Model\Source\Import\Config
*/
protected $config;
/**
* Field constructor.
*
* @param ContextInterface $context
* @param UiComponentFactory $uiComponentFactory
* @param \Firebear\ImportExport\Model\Source\Import\Config $config
* @param array $components
* @param array $data
*/
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
\Firebear\ImportExport\Model\Source\Import\Config $config,
$components = [],
array $data = []
) {
parent::__construct($context, $uiComponentFactory, $components, $data);
$this->config = $config;
}
/**
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function prepare()
{
$entities = [];
foreach ($this->config->getEntities() as $key => $entity) {
$entities[$key] = $entity['name'];
}
if ($config = $this->getDataByKey('config')) {
if (isset($config['valuesForOptions'])) {
$config['valuesForOptions'] = \array_merge($config['valuesForOptions'], $entities);
} else {
$config['valuesForOptions'] = $entities;
}
$this->setData('config', $config);
}
parent::prepare();
}
}