Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ElementObject.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
16 
22  private $name;
23 
29  private $type;
30 
36  private $selector;
37 
43  private $locatorFunction;
44 
50  private $timeout;
51 
57  private $parameterized;
58 
69  public function __construct($name, $type, $selector, $locatorFunction, $timeout, $parameterized)
70  {
71  if ($selector != null && $locatorFunction != null) {
72  throw new XmlException("Element '{$name}' cannot have both a selector and a locatorFunction.");
73  } elseif ($selector == null && $locatorFunction == null) {
74  throw new XmlException("Element '{$name}' must have either a selector or a locatorFunction.'");
75  }
76 
77  $this->name = $name;
78  $this->type = $type;
79  $this->selector = $selector;
80  $this->locatorFunction = $locatorFunction;
81  if (strpos($locatorFunction, "Locator::") === false) {
82  $this->locatorFunction = "Locator::" . $locatorFunction;
83  }
84  $this->timeout = $timeout;
85  $this->parameterized = $parameterized;
86  }
87 
93  public function getName()
94  {
95  return $this->name;
96  }
97 
103  public function getType()
104  {
105  return $this->type;
106  }
107 
113  public function getSelector()
114  {
115  return $this->selector;
116  }
117 
123  public function getLocatorFunction()
124  {
125  return $this->locatorFunction;
126  }
127 
133  public function getPrioritizedSelector()
134  {
135  return $this->selector ?: $this->locatorFunction;
136  }
137 
143  public function getTimeout()
144  {
145  if ($this->timeout == ElementObject::DEFAULT_TIMEOUT_SYMBOL) {
146  return null;
147  }
148 
149  return (int)$this->timeout;
150  }
151 
157  public function isParameterized()
158  {
159  return $this->parameterized;
160  }
161 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
__construct($name, $type, $selector, $locatorFunction, $timeout, $parameterized)