Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contains not working properly #138

Open
Geekimo opened this issue Aug 27, 2016 · 3 comments
Open

contains not working properly #138

Geekimo opened this issue Aug 27, 2016 · 3 comments

Comments

@Geekimo
Copy link

Geekimo commented Aug 27, 2016

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.

@Geekimo
Copy link
Author

Geekimo commented Aug 27, 2016

I noticed a comment in the source code saying that it will not be supported for the time being. Is there any technological issue ?

@Geekimo
Copy link
Author

Geekimo commented Aug 28, 2016

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.

@Geekimo
Copy link
Author

Geekimo commented Aug 28, 2016

Submitted PR #140 to solve issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant