Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ElementVisibilityComposite.php
Go to the documentation of this file.
1 <?php
7 
9 
17 {
24  private $visibility = [];
25 
32  public function __construct(array $visibility = [])
33  {
34  foreach ($visibility as $name => $item) {
35  if (!$item instanceof ElementVisibilityInterface) {
37  __(
38  '%1: Instance of %2 is expected, got %3 instead',
39  $name,
40  ElementVisibilityInterface::class,
41  get_class($item)
42  )
43  );
44  }
45  }
46 
47  $this->visibility = $visibility;
48  }
49 
54  public function isHidden($path)
55  {
56  foreach ($this->visibility as $element) {
57  if ($element->isHidden($path)) {
58  return true;
59  }
60  }
61 
62  return false;
63  }
64 
69  public function isDisabled($path)
70  {
71  foreach ($this->visibility as $element) {
72  if ($element->isDisabled($path)) {
73  return true;
74  }
75  }
76 
77  return false;
78  }
79 }
__()
Definition: __.php:13
if(!isset($_GET['name'])) $name
Definition: log.php:14
$element
Definition: element.phtml:12