class ModelEqualityOperator extends Twig_Node_Expression

A twig operator to test if two models are the same (they are of the same type and have the same ID)

Methods

__construct(Twig_NodeInterface $left, Twig_NodeInterface $right, $lineno)

{@inheritdoc}

compile(Twig_Compiler $compiler)

{@inheritdoc}

static bool
equalModels(Model $a, Model $b)

Checks if $a and $b represent the same object

Details

at line line 14
__construct(Twig_NodeInterface $left, Twig_NodeInterface $right, $lineno)

{@inheritdoc}

Parameters

Twig_NodeInterface $left
Twig_NodeInterface $right
$lineno

at line line 22
compile(Twig_Compiler $compiler)

{@inheritdoc}

Parameters

Twig_Compiler $compiler

at line line 43
static bool equalModels(Model $a, Model $b)

Checks if $a and $b represent the same object

Used as a helper function, since there might be syntax errors when older PHP versions try to parse this: (new Model())->isSameAs($b)

Parameters

Model $a
Model $b

Return Value

bool