Age | Commit message (Collapse) | Author | |
---|---|---|---|
2014-05-28 | Merge pull request #202 from lrlopez/where_id_in-2 | Simon Holywell | |
where_id_in() for selecting multiple records by primary key | |||
2014-05-28 | Merge pull request #201 from lrlopez/where_any_is | Simon Holywell | |
Multiple OR'ed conditions support | |||
2014-05-18 | where_id_in() for selecting multiple records by primary key | Luis Ramón López | |
2014-05-18 | Multiple OR'ed conditions support | Luis Ramón López | |
Multiple OR'ed conditions ------------------------- You can add simple ORed conditions to the same WHERE clause using ``where_any_is``. You should specify multiple conditions using an array of items. Each item will be an associative array that contains a multiple conditions. ```php <?php $people = ORM::for_table('person') ->where_any_is(array( array('name' => 'Joe', 'age' => 10), array('name' => 'Fred', 'age' => 20))) ->find_many(); // Creates SQL: SELECT * FROM `widget` WHERE (( `name` = 'Joe' AND `age` = '10' ) OR ( `name` = 'Fred' AND `age` = '20' )); ``` By default, it uses the equal operator for every column, but it can be overriden for any column using a second parameter: ```php <?php $people = ORM::for_table('person') ->where_any_is(array( array('name' => 'Joe', 'age' => 10), array('name' => 'Fred', 'age' => 20)), array('age' => '>')) ->find_many(); // Creates SQL: SELECT * FROM `widget` WHERE (( `name` = 'Joe' AND `age` > '10' ) OR ( `name` = 'Fred' AND `age` > '20' )); ``` If you want to set the default operator for all the columns, just pass it as the second parameter: ```php <?php $people = ORM::for_table('person') ->where_any_is(array( array('score' => '5', 'age' => 10), array('score' => '15', 'age' => 20)), '>') ->find_many(); // Creates SQL: SELECT * FROM `widget` WHERE (( `score` > '5' AND `age` > '10' ) OR ( `score` > '15' AND `age` > '20' )); ``` | |||
2014-05-06 | Modify test to run query with db not explicitly set | Andrew Meredith | |
2014-04-26 | 1. Adjustment of code to work with multiple raw_joins 2. Test multiple raw joins | Igor Moiseev | |
2014-04-26 | Implemetation of raw_join | Igor Moiseev | |
2014-04-26 | Tests for compound primary keys queries added | Luis Ramón López | |
2014-04-26 | INSERT queries are now compound primary keys aware | Luis Ramón López | |
2014-01-23 | Issue #176 add test for reported case - passes | Simon Holywell | |
2013-08-28 | Add MS SQL `TOP` style syntax support | Simon Holywell | |
2013-08-28 | Merge branch 'vicvicvic-wherealias' of https://github.com/vicvicvic/idiorm ↵ | Simon Holywell | |
into develop | |||
2013-08-18 | Corrects typo in "testJoinWithAliasesAndWhere" method name. | Victor Andrée | |
2013-08-14 | Uses table alias in WHERE | Victor Andrée | |
If a table alias is used for the main table, it's not valid according to the SQL standard to refer to it by it's "real name" (see http://www.postgresql.org/docs/8.2/static/queries-table-expressions.html #QUERIES-TABLE-ALIASES). This causes problems when doing JOIN with a table alias for the "main table", since previous code always used table name. Now, we check for a table alias. | |||
2013-05-08 | Ignore result columns when calling a aggregate function | Tasso Evangelista | |
2013-04-16 | Add support for T-SQL style TOP clauses | Sebastien Bariteau | |
2013-01-23 | Finish transferring tests into PHPUnit | Simon Holywell | |
2013-01-22 | Add in more phpunit tests\! | Simon Holywell | |
2013-01-21 | Add more query building tests | Simon Holywell | |
2013-01-18 | Add more tests to suite | Simon Holywell | |
2013-01-18 | Move more query tests over to PHPUnit | Simon Holywell | |
2013-01-17 | Begin moving query building tests into phpunit | Simon Holywell | |