php-rql
php-rql copied to clipboard
contains not working properly
Hello, the contains function from the php-rql driver only supports one argument, but the JS driver supports multiples arguments.
Plus, the rAnd function should also support multiple arguments, like the JS one.
Is there any method to implement it ? How can I edit the rAnd implementation to make it support multiple arguments ?
Thanks.
I noticed a comment in the source code saying that it will not be supported for the time being. Is there any technological issue ?
Ok, problem solved, I updated the driver the following way by implementing the spec. ATM the solution is PHP7 only but I can support earliers versions of php.
rdb/ValuedQuery/ValuedQuery.php:243
public function contains(...$values)
{
return new Contains($this, $values);
}
rdb/Queries/Aggregations/Contains.php:10
public function __construct(ValuedQuery $sequence, array $values)
{
$this->setPositionalArg(0, $sequence);
foreach($values as $k => $value) {
$this->setPositionalArg($k+1, $this->nativeToDatumOrFunction($value));
}
}
I don't know ATM how to push a PR, but as soon as I know, I'll do it.
I'm working on enhance rAnd and rOr too.
Submitted PR #140 to solve issue