Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SectionObject.php
Go to the documentation of this file.
1 <?php
8 
13 {
19  private $name;
20 
26  private $elements = [];
27 
33  public function __construct($name, $elements)
34  {
35  $this->name = $name;
36  $this->elements = $elements;
37  }
38 
44  public function getName()
45  {
46  return $this->name;
47  }
48 
54  public function getElements()
55  {
56  return $this->elements;
57  }
58 
64  public function hasElement($elementName)
65  {
66  return array_key_exists($elementName, $this->elements);
67  }
68 
75  public function getElement($elementName)
76  {
77  if ($this->hasElement($elementName)) {
78  return $this->elements[$elementName];
79  }
80 
81  return null;
82  }
83 }
$elementName
Definition: gallery.phtml:10