10 use Magento\Mtf\Client\Element\SimpleElement;
22 protected $categoryIds =
'.admin__field[data-index="category_ids"]';
40 if (isset(
$fields[
'custom_attribute'])) {
41 $this->placeholders = [
'attribute_code' =>
$fields[
'custom_attribute'][
'value'][
'code']];
42 $this->applyPlaceholders();
44 return parent::dataMapping(
$fields, $parent);
58 if (isset(
$data[
'attribute_set_id'])) {
60 unset(
$data[
'attribute_set_id']);
63 if (isset(
$data[
'category_ids'])) {
64 if (isset(
$fields[
'category_ids'][
'source'])
65 &&
$fields[
'category_ids'][
'source']->getCategories() !==
null 66 && !
$fields[
'category_ids'][
'source']->getCategories()[0]->hasData(
'id')
68 $this->blockFactory->create(
70 [
'element' => $this->browser->find($this->newCategoryRootElement)]
71 )->addNewCategory(
$fields[
'category_ids'][
'source']->getCategories()[0]);
75 unset(
$data[
'category_ids']);
setFieldsData(array $fields, SimpleElement $element=null)
dataMapping(array $fields=null, $parent=null)