summaryrefslogtreecommitdiff
path: root/docs/querying.rst
AgeCommit message (Collapse)Author
2017-03-21correct some typos in docs :(Simon Holywell
2017-03-21add raw_execute() documentationSimon Holywell
2016-09-22typo on operatorOvidiu Ungureanu
2014-05-18where_id_in() for selecting multiple records by primary keyLuis Ramón López
2014-05-18Multiple OR'ed conditions supportLuis 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-04-26Docs on raw_join implementationIgor Moiseev
2014-04-26Document the new compound primary keys behaviour and featuresLuis Ramón López
2014-04-26Note about precedenceThomas Dybdahl Ahle
2013-09-02Merge branch 'patch-1' of https://github.com/fridde/idiorm into developSimon Holywell
2013-09-01Minor confusionfridde
2013-08-28Document and test PSR-1 compliant method accessSimon Holywell
2013-04-02docs: querying: minor typoBenjamin Ruston
2013-02-28Prepend PHP tag in docsSimon Holywell
2013-02-28Merge branch 'master' of https://github.com/j4mie/idiormSimon Holywell
2013-02-28Attempt to get syntax highlighting workingSimon Holywell
2013-02-20Fix typo in select_many() examplesjparsons
2013-01-15Add ResultSet functionality to IdiormSimon Holywell
2013-01-04Add HAVING clause support to query builderSimon Holywell
2013-01-03Issue #81 Move documentation out of one massive readme fileSimon Holywell