j4mie / idiorm

A lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP5.
http://j4mie.github.com/idiormandparis/
2.01k stars 369 forks source link

Can I combine WHERE closures without where_raw() ? And how ? #164

Closed YanAlex closed 10 years ago

YanAlex commented 10 years ago

I need something like that condition [ where users_enigmas_activitys.user_id <> 38 or (users_enigmas_activitys.user_id = 38 and users_enigmas_activitys.ban <> 1) or users_enigmas_activitys.ban is null ]

treffynnon commented 10 years ago

Only a subset of the available conditions supported by SQL are available when using Idiorm. Additionally, all the WHERE clauses will be ANDed together when the query is run. Support for ORing WHERE clauses is not currently present.

- http://idiorm.readthedocs.org/en/latest/querying.html#caveats

YanAlex commented 10 years ago

What u think about to do some functional like in xPDO, this will not make Paris heavy or very complex but can make some people happier xD

Example:

where ([mixed $conditions = ''], [string $conjunction = xPDOQuery::SQL_AND], [mixed $binding = null], [integer $condGroup = 0])

i know u can say why didnt use xPDO ? Ok, because I cant start so quickly like with ur Paris, I should to define METAfileds XML files at first and so on, but with Paris I want to have speed of developing and a little bit more power

treffynnon commented 10 years ago

Both Idiorm and Paris are considered feature complete so unlikely.