Hoa central
Variable.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Realdom\Crate;
38 
39 use Hoa\Realdom;
40 use Hoa\Visitor;
41 
51 {
57  protected $_variable = null;
58 
59 
60 
67  public function __construct(Realdom\IRealdom\Holder $variable)
68  {
69  $this->setVariable($variable);
70 
71  return;
72  }
73 
80  public function setVariable(Realdom\IRealdom\Holder $variable)
81  {
82  $old = $this->_variable;
83  $this->_variable = $variable;
84  $this->_domains = &$variable->getDomains();
85 
86  return $old;
87  }
88 
94  public function getVariable()
95  {
96  return $this->_variable;
97  }
98 
104  public function &getDomains()
105  {
106  return $this->_domains;
107  }
108 
114  public function getTypes()
115  {
116  $out = [];
117 
118  foreach ($this->getDomains() as $realdom) {
119  $out[] = get_class($realdom);
120  }
121 
122  return $out;
123  }
124 
133  public function accept(
134  Visitor\Visit $visitor,
135  &$handle = null,
136  $eldnah = null
137  ) {
138  return $visitor->visit($this, $handle, $eldnah);
139  }
140 }
setVariable(Realdom\IRealdom\Holder $variable)
Definition: Variable.php:80
accept(Visitor\Visit $visitor, &$handle=null, $eldnah=null)
Definition: Variable.php:133
__construct(Realdom\IRealdom\Holder $variable)
Definition: Variable.php:67