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

helpers: where_null(field), where_not_null(field), where_ne(field) #8

Closed arcijsg closed 13 years ago

arcijsg commented 13 years ago

While building selects via fluent syntax, I felt that at least 2 more where_xxx helper methods would be very helpful:

I can, of course, write where_raw('field IS NOT NULL', array())

but it breaks the charm and is not very intuitive (e.g., where_raw('field IS NOT ?', array(null)) gave me error)

Have I overlooked something already designed for this?

also, I found temptating to write smth like: where_ne($field, $notEqualToThis).

They would be nice "syntactic sugar" and quite simple to implement... Additionally, having column name in "where_xx" methods as a param, could allow to build more advanced interface layers in future on top of idiORM (e.g., converting object property names to column names).

j4mie commented 13 years ago

Hi,

I have added support for where_null and where_not_null in 9a639619d80c9b0d640a3a79fd8779a375c5b28b and where_not_equal in e4d6bad6924fa50b8295da971293671ec3122a51 - thanks for the suggestions.

Can you explain the last paragraph further? I'm not sure I understand what you mean..

j4mie commented 13 years ago

Closing due to lack of response.