I my be in a bit of a "wood for the trees" situation but how is it possible to return elements based on a custom field being between two supplied values.
For example returning users based on a number field. Let's say the number field is between 1 - 100 and I want to return users that have between 5 and 10 selected.
I could do it like the following
$users = craft()->elements->getCriteria(ElementType::User, array("customNumberField"=>array(5,6,7,8,9,10))->find();
However that sets OR
I know that you can use parameters eg "customNumberField"=>"<= 10"
but obviously specifying that key twice causes it to be overwritten.
You can also specify an array with the parameters (avoiding the overwriting) like so
$users = craft()->elements->getCriteria(ElementType::User, array("customNumberField"=>array(">= 5", "<= 10"))->find();
But again this just creates customNumberField >= 5 OR customNumberField <= 10
.
Is it possible to use the array as above but tell it to use AND
instead of OR
?
Am I on the right track or way off?