Hoa central
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Hoa\Ruler\Model\Model Class Reference
Inheritance diagram for Hoa\Ruler\Model\Model:

Public Member Functions

 __set ($name, $value)
 
 getExpression ()
 
 func ()
 
 operation ($name, Array $arguments)
 
 _operator ($name, Array $arguments, $isFunction)
 
 __call ($name, Array $arguments)
 
 variable ($id)
 
 accept (Visitor\Visit $visitor, &$handle=null, $eldnah=null)
 
 __toString ()
 
- Public Member Functions inherited from Hoa\Visitor\Element
 accept (Visit $visitor, &$handle=null, $eldnah=null)
 

Protected Attributes

 $_root = null
 

Static Protected Attributes

static $_compiler = null
 

Detailed Description

Class .

Root of the model, allow to declare everything.

Definition at line 51 of file Model.php.

Member Function Documentation

Hoa\Ruler\Model\Model::__call (   $name,
Array  $arguments 
)

Declare an operation.

Parameters
string$nameName.
array$argumentsArguments.
Returns

Definition at line 150 of file Model.php.

151  {
152  return $this->operation($name, $arguments);
153  }
operation($name, Array $arguments)
Definition: Model.php:125

Here is the call graph for this function:

Hoa\Ruler\Model\Model::__set (   $name,
  $value 
)

Set the expression with $name = 'expression'.

Parameters
string$nameName.
mixed$valueValue.
Returns
void

Definition at line 76 of file Model.php.

77  {
78  if ('expression' !== $name) {
79  return $this->$name = $value;
80  }
81 
82  if (is_scalar($value)) {
83  $value = new Bag\Scalar($value);
84  } elseif (is_array($value)) {
85  $value = new Bag\RulerArray($value);
86  }
87 
88  $this->_root = $value;
89 
90  return;
91  }
Hoa\Ruler\Model\Model::__toString ( )

Transform the object as a string.

Returns
string

Definition at line 187 of file Model.php.

188  {
189  if (null === static::$_compiler) {
190  static::$_compiler = new Ruler\Visitor\Compiler();
191  }
192 
193  return static::$_compiler->visit($this);
194  }
Hoa\Ruler\Model\Model::_operator (   $name,
Array  $arguments,
  $isFunction 
)

Create an operator object.

Parameters
string$nameName.
array$argumentsArguments.
bool$isFunctionWhether it is a function or not.
Returns

Definition at line 138 of file Model.php.

139  {
140  return new Operator(mb_strtolower($name), $arguments, $isFunction);
141  }

Here is the caller graph for this function:

Hoa\Ruler\Model\Model::accept ( Visitor\Visit  $visitor,
$handle = null,
  $eldnah = null 
)

Accept a visitor.

Parameters
\Hoa\Visitor\Visit$visitorVisitor.
mixed&$handleHandle (reference).
mixed$eldnahHandle (no reference).
Returns
mixed

Definition at line 174 of file Model.php.

178  {
179  return $visitor->visit($this, $handle, $eldnah);
180  }
Hoa\Ruler\Model\Model::func ( )

Declare a function.

Parameters
string$nameName.
mixed
Returns

Definition at line 110 of file Model.php.

111  {
112  $arguments = func_get_args();
113  $name = array_shift($arguments);
114 
115  return $this->_operator($name, $arguments, true);
116  }
_operator($name, Array $arguments, $isFunction)
Definition: Model.php:138

Here is the call graph for this function:

Hoa\Ruler\Model\Model::getExpression ( )

Get the expression.

Returns

Definition at line 98 of file Model.php.

99  {
100  return $this->_root;
101  }
Hoa\Ruler\Model\Model::operation (   $name,
Array  $arguments 
)

Declare an operation.

Parameters
string$nameName.
array$argumentsArguments.
Returns

Definition at line 125 of file Model.php.

126  {
127  return $this->_operator($name, $arguments, false);
128  }
_operator($name, Array $arguments, $isFunction)
Definition: Model.php:138

Here is the call graph for this function:

Here is the caller graph for this function:

Hoa\Ruler\Model\Model::variable (   $id)

Declare a variable.

string $id ID.

Returns

Definition at line 161 of file Model.php.

162  {
163  return new Bag\Context($id);
164  }

Member Data Documentation

Hoa\Ruler\Model\Model::$_compiler = null
staticprotected

Definition at line 65 of file Model.php.

Hoa\Ruler\Model\Model::$_root = null
protected

Definition at line 58 of file Model.php.


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