Iff Class

class Iff

Represents an alt or opt block of conditional statements

If an Iff section contains Elsee clauses it is rendered as an alt (alternative) group, otherwise it is rendered as an opt (optional) group

__construct(string $condition)

Create a new Iff conditional group of statements

Parameters:
  • $condition (string) – The condition

Returns:

A new instance of Iff

Return type:

Iff

addElse(Elsee ...$else)

Add Elsee group(s)

Parameters:
  • ...$else (Elsee) – The else group(s)

Returns:

A new instance of Iff with the Elsee group(s) added

Return type:

Iff

addItem(ItemInterface ...$interface)

Add item(s)

Parameters:
  • ...$interface (ItemInterface) – The item(s)

Returns:

A new instance of Andd with the item(s) added

Return type:

Andd

withComment(string $comment)

Sets a comment for the Iff

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Iff with the comment

Return type:

Iff

withElse(Elsee ...$else)

Set Elsee group(s)

Parameters:
  • ...$else (Elsee) – The else group(s)

Returns:

A new instance of Iff with the Elsee group(s)

Return type:

Iff

withItem(ItemInterface ...$interface)

Set item(s)

Parameters:
  • ...$interface (ItemInterface) – The item(s)

Returns:

A new instance of Andd with the item(s)

Return type:

Andd