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

Create complex filters with multiple properties #2

Open
bgaillard opened this issue Aug 1, 2017 · 0 comments
Open

Create complex filters with multiple properties #2

bgaillard opened this issue Aug 1, 2017 · 0 comments

Comments

@bgaillard
Copy link
Member

The purpose of this case is to implement complex filters based on multiple properties. This could be provided with a special filter URL query parameter in a Web Service for example.

GET /products?enabled=true&filter=price:<90-validity:>=3

This will retrieve products havin a price lower than 80 OR a validity greater or equals to 3.

The : in an equals operator and prevents conflicts with the = operator used in the URL query parameters.

A sample call using the Gomoob Data Mapper / Service Layer standard conventions would be for example.

$this->productService->fetch(
    $offset,
    $pageSize,
    [
        'enabled' => true,
        0 => 'price:<90-validity:>=3'
    ]
);

Please note that we use integer key to differentiate simple property filters from complex property filters.

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

No branches or pull requests

1 participant