Hoa central
Public Member Functions | Static Protected Attributes | List of all members
Hoa\Xyl\Interpreter\Common\XylIf Class Reference
Inheritance diagram for Hoa\Xyl\Interpreter\Common\XylIf:

Public Member Functions

 paint (Stream\IStream\Out $out)
 
 structuralCompute (Stream\IStream\Out $out)
 
- Public Member Functions inherited from Hoa\Xyl\Element\Concrete
 computeDataBinding (Array &$data, Array &$parent=null)
 
 render (Stream\IStream\Out $out)
 
 computeValue (Stream\IStream\Out $out=null)
 
 computeTransientValue (Stream\IStream\Out $out=null)
 
 computeAttributeValue ($value, $type=self::ATTRIBUTE_TYPE_UNKNOWN, $name=null)
 
 isLastIteration ()
 
 setVisibility ($visibility)
 
 getVisibility ()
 
- Public Member Functions inherited from Hoa\Xml\Element\Concrete
 __construct (Element $abstract, Element $superRoot, Array $rank=[], $namespace=null)
 
 construct ()
 
 getAbstractElement ()
 
 getAbstractElementSuperRoot ()
 
 getName ()
 
 count ()
 
 getIterator ()
 
 __set ($name, Concrete $value)
 
 __get ($name)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $element)
 
 offsetUnset ($offset)
 
 __call ($name, Array $arguments=[])
 

Static Protected Attributes

static $_attributes
 
- Static Protected Attributes inherited from Hoa\Xyl\Element\Concrete
static $_attributes
 
- Static Protected Attributes inherited from Hoa\Xml\Element\Concrete
static $_store = []
 
static $_superRoots = []
 
static $_multiton = []
 

Additional Inherited Members

- Static Public Member Functions inherited from Hoa\Xml\Element\Concrete
static getAbstractElementId (Element $element)
 
static getConcreteElement (Element $element)
 
static getAbstractElementSuperRootOf (Element $element)
 
- Public Attributes inherited from Hoa\Xyl\Element\Concrete
const ATTRIBUTE_TYPE_UNKNOWN = 0
 
const ATTRIBUTE_TYPE_NORMAL = 1
 
const ATTRIBUTE_TYPE_ID = 2
 
const ATTRIBUTE_TYPE_CUSTOM = 4
 
const ATTRIBUTE_TYPE_LIST = 8
 
const ATTRIBUTE_TYPE_LINK = 16
 
- Protected Member Functions inherited from Hoa\Xyl\Element\Concrete
 selectData ($expression, Array &$bucket)
 
 getCurrentData ()
 
 paint (Stream\IStream\Out $out)
 
 cleanTransientValue ()
 
 formatValue ($value, $name=null)
 
 _formatValue ($value)
 
 computeFromString ($xyl)
 
 getDeclaredAttributes ()
 
- Static Protected Member Functions inherited from Hoa\Xyl\Element\Concrete
static _getDeclaredAttributes ()
 
- Protected Attributes inherited from Hoa\Xyl\Element\Concrete
 $_visibility = true
 
 $_transientValue = null
 
 $_lastIteration = false
 
- Protected Attributes inherited from Hoa\Xml\Element\Concrete
 $_name = null
 
 $_children = []
 
 $_iterator = []
 
 $abstract = null
 
 $_superRoot = null
 

Detailed Description

Class .

The <if> component.

Definition at line 50 of file XylIf.php.

Member Function Documentation

Hoa\Xyl\Interpreter\Common\XylIf::paint ( Stream\IStream\Out  $out)

Paint the element.

Parameters
\Hoa\Stream\IStream\Out$outOut stream.
Returns
void

Definition at line 69 of file XylIf.php.

70  {
71  return $this->structuralCompute($out);
72  }
structuralCompute(Stream\IStream\Out $out)
Definition: XylIf.php:80

Here is the call graph for this function:

Hoa\Xyl\Interpreter\Common\XylIf::structuralCompute ( Stream\IStream\Out  $out)

Structural compute (if/elseif/else).

Parameters
\Hoa\Stream\IStream\Out$outOut stream.
Returns
void

Definition at line 80 of file XylIf.php.

81  {
82  $verdict = false;
83 
84  if (true === $this->abstract->attributeExists('test')) {
85  $verdict = Xyl::evaluateXPath(
86  $this->computeAttributeValue(
87  $this->abstract->readAttribute('test'),
88  self::ATTRIBUTE_TYPE_NORMAL
89  )
90  );
91  }
92 
93  if (false === $verdict) {
94  $next = $this->abstract->selectAdjacentSiblingElement('elseif')
95  ?: $this->abstract->selectAdjacentSiblingElement('else');
96 
97  if (false === $next) {
98  return;
99  }
100 
101  $this->getConcreteElement($next)->structuralCompute($out);
102 
103  return;
104  }
105 
106  $this->computeValue($out);
107 
108  return;
109  }
computeValue(Stream\IStream\Out $out=null)
Definition: Concrete.php:410
static evaluateXPath($expression)
Definition: Xyl.php:1760
static getConcreteElement(Element $element)
Definition: Concrete.php:212
computeAttributeValue($value, $type=self::ATTRIBUTE_TYPE_UNKNOWN, $name=null)
Definition: Concrete.php:488

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Hoa\Xyl\Interpreter\Common\XylIf::$_attributes
staticprotected
Initial value:
= [
'test' => self::ATTRIBUTE_TYPE_NORMAL
]

Definition at line 57 of file XylIf.php.


The documentation for this class was generated from the following file: