Open vicary opened 11 years ago
Logical groups AND
and OR
should be made so that it is meaningful in nesting levels, as well as the root level of the specified $filter
array for Node::get()
.
Taking reference to other model frameworks like Magento and ShopNC, something like array( 'eq' => $value )
would be viable and intuitive to use.
I am starting to love the BDD style totally chainable interfaces.
May rework this into something like this, while totally separates the Database dependency.
$data = Node($collection)
->filter($filter)
->map()
->filter($more_filter)
->get();
Currently plain values in the filter is basically AND filtered, while arrays are OR filtered, consider the following code:
This basically selects everything in the
foo
collection, with theirname
field starts with"pre"
, and theirtype
field either equals to"a"
OR"b"
.This way is not very clear, needs to better separate between AND and OR.
The array OR method will be kept as a shorthand, while the real OR way is giving multiple arrays as the filter.