Parziphal / parse

Parse with an Eloquent-like interface for Laravel
MIT License
17 stars 13 forks source link

orQueries example #23

Closed nafplann closed 5 years ago

nafplann commented 5 years ago

Hi.. do you have any examples of how to use orQueries?

Parziphal commented 5 years ago

Hi, they're called like this (copypasted from src/Query.php). Note that Query refers to Parziphal\Parse\Query:

Pass Query, ParseQuery or Closure, as params or in an array. If Closure is passed, a new Query will be passed as parameter. First element must be an instance of Query.

$orQuery = Query::orQueries($query, $parseQuery);
$orQuery = Query::orQueries([$query, $parseQuery]);
$orQuery = Query::orQueries($query, function(Query $query) { $query->where(...); });
nafplann commented 5 years ago

thank you, i'll try that