final class CallArgument
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One argument of a call written as name(...), with the alias a loadable function receives as the name of the argument.

Without an alias a loadable function sees the text of the argument as its name; native functions reject an alias. The call that holds the argument derives its expression. Source: https://dev.mysql.com/doc/refman/8.4/en/udf-arguments.html.

Reading an argument and its aliasdoctest
$argument = new \SqlSemantics\Platform\MySql\Statement\Call\CallArgument(new \SqlSemantics\Platform\MySql\Statement\Name\ColumnUse(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('a')), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('total'));
    [$argument->expression->name->value, $argument->alias?->value] // => ['a', 'total']

Properties§

public Scalar $expression
public Name|null $alias = null
public AliasMark $mark = AliasMark::As

Methods§

public function __construct(
    public Scalar $expression,
    public Name|null $alias = null,
    public AliasMark $mark = AliasMark::As,
)

Parameters

$expressionScalarThe argument expression
$aliasName|nullThe alias written after it
$markAliasMarkWhether the alias is written after AS

Throws

InvalidConstruction When the mark does not fit the alias
Calls 3
public function render(Output $out): void

Writes the expression and its alias.

Parameters

$outOutput
Test cases 1
Calls 4

Test cases 9§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 8

Relations§

Instantiated in 3
Constant reads 1
Type declarations 1