Skip to content

Instantly share code, notes, and snippets.

@LubosRemplik
Last active June 22, 2018 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LubosRemplik/f85cf696512f69fdcc8d5b0255c09aee to your computer and use it in GitHub Desktop.
Save LubosRemplik/f85cf696512f69fdcc8d5b0255c09aee to your computer and use it in GitHub Desktop.
public function findClient(Query $query, array $options)
{
$query->matching(
'OfferTypes', function ($q) use ($options) {
return $q->where(['OfferTypes.id' => $options['client']['offer_type_id']]);
}
);
$query->matching('Clients', function ($q) use ($options) {
return $q->where(['Clients.name' => $options['client']['name']]);
});
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment