eZPublish  3.8
eZTemplateLoop Class Reference

Code common for the loop functions in processed mode. More...

Public Member Functions

 cleanup ()
 
 eZTemplateLoop ($functionName, &$functionParameters, &$functionChildren, &$functionPlacement, &$tpl, &$textElements, &$rootNamespace, &$currentNamespace)
 
 hasSequence ()
 
 incrementSequence ()
 
 initialized ()
 
 initLoopVariable ($varName)
 
 parseParamValue ($paramName, &$dst)
 
 parseParamVarName ($paramName, &$dst)
 
 parseScalarParamValue ($paramName, &$dst, &$isProxyObject)
 
 processChildren ()
 
 processDelimiter ($index=false)
 
 processFunctionParameters ()
 
 resetIteration ()
 
 setSequenceVar ()
 

Private Attributes

 $CurrentNamespace
 
 $delimiter
 
 $FunctionChildren
 
 $FunctionName
 
 $FunctionParameters
 
 $FunctionPlacement
 
 $Initialized
 
 $LoopVariablesNames
 
 $RootNamespace
 
 $Sequence
 
 $SequenceVarName
 
 $SkipDelimiter
 
 $SkipSequenceIncrement
 
 $TextElements
 
 $Tpl
 

Detailed Description

Code common for the loop functions in processed mode.

Member Function Documentation

eZTemplateLoop::cleanup ( )

Destroys template variables defined by the loop.

eZTemplateLoop::eZTemplateLoop (   $functionName,
$functionParameters,
$functionChildren,
$functionPlacement,
$tpl,
$textElements,
$rootNamespace,
$currentNamespace 
)
eZTemplateLoop::hasSequence ( )

Returns true if sequence has been specified for the loop in its parameters.

Referenced by incrementSequence(), and setSequenceVar().

eZTemplateLoop::incrementSequence ( )

Increment current sequence value.

eZTemplateLoop::initialized ( )
Returns
true if the object has been correctly initialized, false otherwise
eZTemplateLoop::initLoopVariable (   $varName)

Checks if the given loop variable already exists. If it doesn't, store its name for later cleanup. Otherwise shows a warning message.

See Also
eZTemplateLoop::$loopVariablesNames

Referenced by processFunctionParameters().

eZTemplateLoop::parseParamValue (   $paramName,
$dst 
)

Parses value the given function parameter and stores it to $dst.

Parameters
$paramNameParameter name.
$dstWhere to store parameter value.
Returns
false if specified parameter is not found or it is wrong, otherwise true is returned.
eZTemplateLoop::parseParamVarName (   $paramName,
$dst 
)

Parses the given function parameter that is supposed to contain a variable name. Extracted variable name is stored to $dst.

Parameters
$paramNameParameter name.
$dstWhere to store parameter value.
Returns
false if specified parameter is not found or it is wrong, otherwise true is returned.

Referenced by processFunctionParameters().

eZTemplateLoop::parseScalarParamValue (   $paramName,
$dst,
$isProxyObject 
)

Parses given function parameter and makes sure that it is not a proxy object ({section} loop iterator).

Parameters
$paramNameParameter name.
$dstWhere to store parameter value.
$isProxyObjectboolean true is stored here if value of the parameter is a proxy object.
Returns
false if specified parameter is not found or it is wrong, otherwise true is returned.
eZTemplateLoop::processChildren ( )
eZTemplateLoop::processDelimiter (   $index = false)

If $loopCondition is true, shows delimiter (if one has been specified).

Parameters
$indexis needed for processing delimiter parameters such as modulo. Is current iteration index.
Returns
true if the caller loop should break, false otherwise
eZTemplateLoop::processFunctionParameters ( )
Returns
true on success, false otherwise.

Referenced by eZTemplateLoop().

eZTemplateLoop::resetIteration ( )

Should be called each time a new iteration is started. Resets some internal variables.

eZTemplateLoop::setSequenceVar ( )

Export current loop sequence value to the template variable specified in loop parameters.

Member Data Documentation

eZTemplateLoop::$CurrentNamespace
private
eZTemplateLoop::$delimiter
private
eZTemplateLoop::$FunctionChildren
private
eZTemplateLoop::$FunctionName
private
eZTemplateLoop::$FunctionParameters
private
eZTemplateLoop::$FunctionPlacement
private
eZTemplateLoop::$Initialized
private

Referenced by initialized().

eZTemplateLoop::$LoopVariablesNames
private

Before we create a new loop variable, we check if it already exists. If it doesn't, we store its name in this array, so that we know which variables to destroy after the loop execution finishes.

eZTemplateLoop::$RootNamespace
private

Referenced by setSequenceVar().

eZTemplateLoop::$Sequence
private
eZTemplateLoop::$SequenceVarName
private
eZTemplateLoop::$SkipDelimiter
private
eZTemplateLoop::$SkipSequenceIncrement
private
eZTemplateLoop::$TextElements
private
eZTemplateLoop::$Tpl
private

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