cakephp/cakephp — pull request #2543 by ozzyogkush (2013-12-24 16:06:41+00:00)
Title: Allow condition keys with : or ? chars in sequence

This was failing when attempting to cast values inside a key; ie:

`'Model.field::integer' => array(1, 2)` or
`'"Model"."field"::integer' => array(1, 2)`

where the number of `:` or `?` characters is equal to the number of elements in the value array.

That would cause it to attempt to run the `__parseKey()` function, ending up with a condition segment string such as `... "Model"."field"::integer = ` which was not the intended behavior.

This patch looks to see if the characters are all next to each other. If so, we can safely assume that the user is not trying to interpolate the values into the key string.

Since it checks for question marks first, this also allows casted condition keys to use BETWEEN syntax, ie: `'"Model"."field"::integer BETWEEN ? and ?' => array(1, 100)`

would output the expected condition:
`"Model"."field"::integer BETWEEN '1' and '100'`