Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZTemplateLogicOperator Class Reference
Template system » Template operators

Logical operators for creating and manipulating booleans. More...

## Public Member Functions
| __construct ()
| operatorList ()
| namedParameterPerOperator ()
| operatorTemplateHints ()
| operatorCompiledStaticData ( $operatorName)
| namedParameterList ()
| logicalComparisonTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| negateTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| trueFalseTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| chooseTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| getValueCount ( $val)
| modify ( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters, $placement)

## Public Attributes
| $Operators
| $LtName
| The "less than" name. More...
| $GtName
| The "greater than" name. More...
| $LeName
| The "less than or equal" name. More...
| $GeName
| The "greater than or equal" name. More...
| $EqName
| The "equal" name. More...
| $NeName
| The "not equal" name. More...
| $NullName
| The "null" name. More...
| $NotName
| The "not" name. More...
| $OrName
| The "or" name. More...
| $AndName
| The "and" name. More...
| $TrueName
| The "true" name. More...
| $FalseName
| The "false" name. More...
| $ChooseName
| The "choose" name. More...

## Detailed Description

Logical operators for creating and manipulating booleans.

This class adds powerful template handling by enabling logical operators which alter the output of templates from input values.

How counts are interpreted:

1. If the data is an array the array count is used
2. If the data is an object the object attribute count is used
3. If the data is a numeric the value is used
4. If the data is a boolean false is 0 and true is 1
5. For all other data 0 is used

Data is considered null (or false) if the data count is 0 (see above) or the data is really null (is_null). Data is considered true if it is not null.

The supported operators are:

- lt
  Returns true if the input count is less than the parameter data count. See how count is interpreted above.
- le
  Same as lt but use less than or equal to.
- gt
  Same as lt but returns true for input greater than data.
- ge
  Same as gt but use greater than or equal to.
- eq
  Returns true if all the input parameters match. Matching is casual meaning that an integer of value 0 will match a boolean of type false.
- ne
  Returns true if one or more of the input parameters does not match. Matching is casual meaning that an integer of value 0 will match a boolean of type false.
- null
  Returns true if the data is null, false otherwise
- not
  Returns true if the data is false or false if data is true
- true
- false
  Creates a true/false boolean
- or
  Evaluates all parameter values until one is found to be true (see above), then returns that value. The remaining parameters are not evaluated at all. If there are no parameter or all elements were false it returns false.
- and
  Evaluates all parameter values until one is found to be false (see above), then returns that false. The remaining parameters are not evaluated at all. If there are no parameter it returns false, if no elements were false it returns the last parameter value.
- choose
  Uses the input count to pick one of the parameter elements. The input count equals the parameter index.

Definition at line 67 of file eztemplatelogicoperator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTemplateLogicOperator::__construct | ( |  | ) |

Initializes the operator class with the various operator names.

Definition at line 72 of file eztemplatelogicoperator.php.

## Member Function Documentation

## ◆ chooseTransformation()

eZTemplateLogicOperator::chooseTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 516 of file eztemplatelogicoperator.php.

References eZTemplateNodeTool\createCodePieceElement(), eZTemplateNodeTool\elementConstantValue(), eZTemplateNodeTool\extractVariableNodePlacement(), and eZTemplateNodeTool\isConstantElement().

## ◆ getValueCount()

eZTemplateLogicOperator::getValueCount | ( |  | $val | ) |

Returns the 'count' value as described in the introduction or 'false' in case of an unsupported type

Definition at line 596 of file eztemplatelogicoperator.php.

Referenced by modify().

## ◆ logicalComparisonTransformation()

eZTemplateLogicOperator::logicalComparisonTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 236 of file eztemplatelogicoperator.php.

References eZTemplateNodeTool\createBooleanElement(), eZTemplateNodeTool\createCodePieceElement(), eZTemplateNodeTool\createConstantElement(), eZTemplateNodeTool\elementConstantValue(), and eZTemplateNodeTool\isConstantElement().

## ◆ modify()

eZTemplateLogicOperator::modify | ( |  | $tpl,
|  |  | $operatorName,
|  |  | $operatorParameters,
|  |  | $rootNamespace,
|  |  | $currentNamespace,
|  | & | $value,
|  |  | $namedParameters,
|  |  | $placement
| ) |  |

Examines the input value and outputs a boolean value. See class documentation for more information.

Definition at line 631 of file eztemplatelogicoperator.php.

References $TrueName, and getValueCount().

## ◆ namedParameterList()

eZTemplateLogicOperator::namedParameterList | ( |  | ) |

See eZTemplateOperator::namedParameterList

Definition at line 219 of file eztemplatelogicoperator.php.

## ◆ namedParameterPerOperator()

eZTemplateLogicOperator::namedParameterPerOperator | ( |  | ) |

Returns
  true to tell the template engine that the parameter list exists per operator type.

Definition at line 97 of file eztemplatelogicoperator.php.

## ◆ negateTransformation()

eZTemplateLogicOperator::negateTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 480 of file eztemplatelogicoperator.php.

References eZTemplateNodeTool\createCodePieceElement().

## ◆ operatorCompiledStaticData()

eZTemplateLogicOperator::operatorCompiledStaticData | ( |  | $operatorName | ) |

Definition at line 200 of file eztemplatelogicoperator.php.

## ◆ operatorList()

eZTemplateLogicOperator::operatorList | ( |  | ) |

Returns the operators in this class.

Definition at line 89 of file eztemplatelogicoperator.php.

References $Operators.

## ◆ operatorTemplateHints()

eZTemplateLogicOperator::operatorTemplateHints | ( |  | ) |

Definition at line 102 of file eztemplatelogicoperator.php.

## ◆ trueFalseTransformation()

eZTemplateLogicOperator::trueFalseTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 499 of file eztemplatelogicoperator.php.

References eZTemplateNodeTool\createBooleanElement().

## Member Data Documentation

## ◆ $AndName

eZTemplateLogicOperator::$AndName

The "and" name.

Definition at line 887 of file eztemplatelogicoperator.php.

## ◆ $ChooseName

eZTemplateLogicOperator::$ChooseName

The "choose" name.

Definition at line 893 of file eztemplatelogicoperator.php.

## ◆ $EqName

eZTemplateLogicOperator::$EqName

The "equal" name.

Definition at line 877 of file eztemplatelogicoperator.php.

## ◆ $FalseName

eZTemplateLogicOperator::$FalseName

The "false" name.

Definition at line 891 of file eztemplatelogicoperator.php.

## ◆ $GeName

eZTemplateLogicOperator::$GeName

The "greater than or equal" name.

Definition at line 875 of file eztemplatelogicoperator.php.

## ◆ $GtName

eZTemplateLogicOperator::$GtName

The "greater than" name.

Definition at line 871 of file eztemplatelogicoperator.php.

## ◆ $LeName

eZTemplateLogicOperator::$LeName

The "less than or equal" name.

Definition at line 873 of file eztemplatelogicoperator.php.

## ◆ $LtName

eZTemplateLogicOperator::$LtName

The "less than" name.

Definition at line 869 of file eztemplatelogicoperator.php.

## ◆ $NeName

eZTemplateLogicOperator::$NeName

The "not equal" name.

Definition at line 879 of file eztemplatelogicoperator.php.

## ◆ $NotName

eZTemplateLogicOperator::$NotName

The "not" name.

Definition at line 883 of file eztemplatelogicoperator.php.

## ◆ $NullName

eZTemplateLogicOperator::$NullName

The "null" name.

Definition at line 881 of file eztemplatelogicoperator.php.

## ◆ $Operators

eZTemplateLogicOperator::$Operators

The array of operators

Definition at line 867 of file eztemplatelogicoperator.php.

Referenced by operatorList().

## ◆ $OrName

eZTemplateLogicOperator::$OrName

The "or" name.

Definition at line 885 of file eztemplatelogicoperator.php.

## ◆ $TrueName

eZTemplateLogicOperator::$TrueName

The "true" name.

Definition at line 889 of file eztemplatelogicoperator.php.

Referenced by modify().

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

- eztemplatelogicoperator.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.