Namespace: RsORM\Query\Engine\MySQL\Argument
Arguments are basic MySQL engine entities. They implements ObjectInterface, SingleValueInterface or MultiValueInterface. So they all has method prepare without input parameters and some of them has methods value or values without input parameters too.
Here is list of all arguments:
This class creates object, which corresponds MySQL alias argument using in context like this:
`name` AS `alias`
It has one input parameter - name of alias, string type.
$alias = new Argument\Alias("alias");
$alias->prepare(); // `alias`Corresponds MySQL argument *, has no input parameters.
$any = new Argument\Any();
$any->prepare(); // *Corresponds MySQL sorting in ORDER and GROUP clauses, has one input parameter, which should be instance of Alias, Column or Table.
$asc = new Argument\Asc(new Argument\Column("id"));
$asc->prepare(); // ASC `id`Corresponds MySQL column argument, has one input parameter - name of column, string type.
$column = new Argument\Column("id");
$column->prepare(); // `id`Corresponds MySQL sorting in ORDER and GROUP clauses, has one input parameter, which should be instance of Alias, Column or Table.
$desc = new Argument\Desc(new Argument\Column("id"));
$desc->prepare(); // DESC `id`Corresponds MySQL DEFAULT value in SET or VALUES clauses of UPDATE, INSERT and REPLACE MySQL statements. Has no input parameters.
$defaultValue = new Argument\DefaultValue();
$defaultValue->prepare(); // DEFAULTCorresponds MySQL field object for SELECT statement, has two input parameters:
- expression - any instance of
ObjectInterface, for example, column or any function (instance of any class from namespaceQuery\Engine\MySQL\Func). - alias -
Aliasobject, optional parameter.
$field = new Argument\Field(
new Argument\Column("user_id"),
new Argument\Alias("uid")
);
$field->prepare(); // `user_id` AS `uid`$field = new Argument\Field(
new Func\Count(new Argument\Column("id")),
new Argument\Alias("num")
);
$field->prepare(); // COUNT(`id`) AS `num`Corresponds MySQL NULL value, has no input parameters.
$nullValue = new Argument\NullValue();
$nullValue->prepare(); // NULLCorresponds MySQL table adentifier, has one input parameter - table name, string type.
$table = new Argument\Table("table");
$table->prepare(); // `table`Corresponds MySQL values, in prepared statement it displays as ?, for getting actual value you can use value method. It has one input parameter - int, double, string or boolean type.
$value = new Argument\Value(123);
$value->prepare(); // ?
$value->value(); // 123