Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OperationElement.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  private $key;
17 
23  private $value;
24 
30  private $type;
31 
37  private $nestedElements = [];
38 
44  private $nestedMetadata = [];
45 
50  private $required;
51 
61  public function __construct($key, $value, $type, $required, $nestedElements = [], $nestedMetadata = null)
62  {
63  $this->key = $key;
64  $this->value = $value;
65  $this->type = $type;
66  $this->nestedElements = $nestedElements;
67  if ($required) {
68  $this->required = true;
69  } else {
70  $this->required = false;
71  }
72  $this->nestedMetadata = $nestedMetadata;
73  }
74 
80  public function getKey()
81  {
82  return $this->key;
83  }
84 
90  public function getValue()
91  {
92  return $this->value;
93  }
94 
100  public function getType()
101  {
102  return $this->type;
103  }
104 
110  public function isRequired()
111  {
112  return $this->required;
113  }
114 
121  public function getNestedOperationElement($type)
122  {
123  if (array_key_exists($type, $this->nestedElements)) {
124  return $this->nestedElements[$type];
125  }
126 
127  return [];
128  }
129 
135  public function getNestedMetadata()
136  {
137  return $this->nestedMetadata;
138  }
139 }
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
__construct($key, $value, $type, $required, $nestedElements=[], $nestedMetadata=null)