eZTemplateLogicOperator Class Reference
[Template operators]

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

List of all members.


Public Methods

 eZTemplateLogicOperator ($lt_name="lt",$gt_name="gt",$le_name="le",$ge_name="ge",$eq_name="eq",$ne_name="ne",$null_name="null",$not_name="not",$true_name="true",$false_name="false",$or_name="or",$and_name="and",$choose_name="choose")
operatorList ()
 namedParameterPerOperator ()
 namedParameterList ()
 modify (&$tpl,&$operatorName,&$operatorParameters,&$rootNamespace,&$currentNamespace,&$value,&$namedParameters)

Public Attributes

 Operators
 The array of operators.

 LTName
 The "less than" name.

 GTName
 The "greater than" name.

 LEName
 The "less than or equal" name.

 GEName
 The "greater than or equal" name.

 EQName
 The "equal" name.

 NEName
 The "not equal" name.

 NullName
 The "null" name.

 NotName
 The "not" name.

 OrName
 The "or" name.

 AndName
 The "and" name.

 TrueName
 The "true" name.

 FalseName
 The "false" name.

 ChooseName
 The "choose" name.


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 eztemplatelogicoperator.php.


Constructor & Destructor Documentation

eZTemplateLogicOperator::eZTemplateLogicOperator   lt_name = "lt",
  gt_name = "gt",
  le_name = "le",
  ge_name = "ge",
  eq_name = "eq",
  ne_name = "ne",
  null_name = "null",
  not_name = "not",
  true_name = "true",
  false_name = "false",
  or_name = "or",
  and_name = "and",
  choose_name = "choose"
 

Initializes the operator class with the various operator names.

Parameters:
lt_name  The name for the "less than" operator
gt_name  The name for the "greater than" operator
le_name  The name for the "less than or equal" operator
ge_name  The name for the "greater than or equal" operator
eq_name  The name for the "equal" operator
ne_name  The name for the "not equal" operator
null_name  The name for the "is null" operator
not_name  The name for the "not" operator
true_name  The name for the "create true boolean" operator
false_name  The name for the "create false boolean" operator
or_name  The name for the "logical or" operator
and_name  The name for the "logical and" operator
choose_name  The name for the "choose" operator

Definition at line eztemplatelogicoperator.php.

References TrueName.


Member Function Documentation

eZTemplateLogicOperator::modify &$    tpl,
&$    operatorName,
&$    operatorParameters,
&$    rootNamespace,
&$    currentNamespace,
&$    value,
&$    namedParameters
 

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

Definition at line eztemplatelogicoperator.php.

References TrueName.

eZTemplateLogicOperator::namedParameterList  
 

See eZTemplateOperator::namedParameterList

Definition at line eztemplatelogicoperator.php.

eZTemplateLogicOperator::namedParameterPerOperator  
 

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

Definition at line eztemplatelogicoperator.php.

& eZTemplateLogicOperator::operatorList  
 

Returns the operators in this class.

Definition at line eztemplatelogicoperator.php.

References Operators.


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

Exponential