Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BundlePrice.php
Go to the documentation of this file.
1 <?php
7 
12 
17 {
18  const CODE_PRICE_TYPE = 'price_type';
19  const CODE_TAX_CLASS_ID = 'tax_class_id';
20 
24  protected $arrayManager;
25 
29  protected $locator;
30 
35  public function __construct(
38  ) {
39  $this->locator = $locator;
40  $this->arrayManager = $arrayManager;
41  }
42 
46  public function modifyMeta(array $meta)
47  {
48  $meta = $this->arrayManager->merge(
49  $this->arrayManager->findPath(static::CODE_PRICE_TYPE, $meta, null, 'children') . static::META_CONFIG_PATH,
50  $meta,
51  [
52  'disabled' => (bool)$this->locator->getProduct()->getId(),
53  'valueMap' => [
54  'false' => '1',
55  'true' => '0'
56  ],
57  'validation' => [
58  'required-entry' => false
59  ]
60  ]
61  );
62 
63  $meta = $this->arrayManager->merge(
64  $this->arrayManager->findPath(
66  $meta,
67  null,
68  'children'
69  ) . static::META_CONFIG_PATH,
70  $meta,
71  [
72  'imports' => [
73  'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
74  ]
75  ]
76  );
77 
78  $meta = $this->arrayManager->merge(
79  $this->arrayManager->findPath(
80  static::CODE_TAX_CLASS_ID,
81  $meta,
82  null,
83  'children'
84  ) . static::META_CONFIG_PATH,
85  $meta,
86  [
87  'imports' => [
88  'disabled' => 'ns = ${ $.ns }, index = ' . static::CODE_PRICE_TYPE . ':checked'
89  ]
90  ]
91  );
92 
93  return $meta;
94  }
95 
99  public function modifyData(array $data)
100  {
101  return $data;
102  }
103 }
return false
Definition: gallery.phtml:36
__construct(LocatorInterface $locator, ArrayManager $arrayManager)
Definition: BundlePrice.php:35