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.
The purpose of this case is to implement complex filters based on multiple properties. This could be provided with a special
filterURL query parameter in a Web Service for example.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.
Please note that we use integer key to differentiate simple property filters from complex property filters.