Skip to content

Instantly share code, notes, and snippets.

@chanmix51
Last active December 28, 2015 00:19
Show Gist options
  • Save chanmix51/7412106 to your computer and use it in GitHub Desktop.
Save chanmix51/7412106 to your computer and use it in GitHub Desktop.
<?php
$where1 = Pomm\Query\Where::createWhereIn('customer_id', array(1, 2, 3, 5, 7, 11, 13))
->andWhere('first_name ~* $*', array('^jo[aeiouy]'))
->orWhere('age >= $*', array('21'))
;
$where2 = Pomm\Query\Where::create('location <@ cast($* AS circle)', array('<(44.234, -0.643), 3.44>'))
->orWhere($where1);
// where2: (location <@ cast($* AS circle) OR ((customer_id IN ($*, $*, $*, $*, $*, $*, $*) AND first_name ~* $*) OR age >= $*))
// values: <(44.234, -0.643), 3.44>, 1, 2, 3, 5, 7, 11, 13, 'john', 21
return $map->findWhere($where2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment