IncludeConditionInterface

Source streams that contain conditions are split smaller parts and each condition creates a Condition node.

This interface is implemented by all conditions nodes. It allows "parking" the main condition token to be evaluated during AST building.

Tags
internal:

Internal tree structure.

Table of Contents

Methods

getConditionToken()  : Token
getConditionVerdict()  : bool
getOriginalConditionToken()  : Token|null
isConditionNegated()  : bool
True for ConditionElseInclude: The [ELSE] node of a condition.
setConditionToken()  : void
Set and get the condition token: "[foo = bar]"
setConditionVerdict()  : void
When a condition is evaluated, this is set to true of false depending on the condition result.
setOriginalConditionToken()  : void
Conditions may use constants: "[foo = {$bar}]". This getter/setter allows storing the original condition token string.

Methods

getConditionVerdict()

public getConditionVerdict() : bool
Return values
bool

getOriginalConditionToken()

public getOriginalConditionToken() : Token|null
Return values
Token|null

isConditionNegated()

True for ConditionElseInclude: The [ELSE] node of a condition.

public isConditionNegated() : bool
Return values
bool

setConditionToken()

Set and get the condition token: "[foo = bar]"

public setConditionToken(Token $token) : void
Parameters
$token : Token

setConditionVerdict()

When a condition is evaluated, this is set to true of false depending on the condition result.

public setConditionVerdict(bool $verdict) : void
Parameters
$verdict : bool

setOriginalConditionToken()

Conditions may use constants: "[foo = {$bar}]". This getter/setter allows storing the original condition token string.

public setOriginalConditionToken(Token $token) : void

This is set in backend only in case a constant substitution has taken place. Otherwise, the "vanilla" condition token is identical, getOriginalConditionToken() returns null and the condition token should be fetched from getConditionToken().

Parameters
$token : Token

        
On this page

Search results