Age | Commit message (Collapse) | Author |
|
|
|
|
|
into tentwofour-bugfix-orm-is-dirty
|
|
return false when fields have been set null.
Update ORMTest#testIsDirty - added tests for filed set to '' and null
|
|
|
|
This is a combination of 20 commits:
added cache callback #212
added test
Added text for custom cache
formating and tests
added caching_auto_clear option
moved custom cache test for php 5.3+
fixed ConfigTest.php
tabs to spaces
formating
formating
added `create_cache_key` callback option
added $table_name to clear cache function
added $table_name to _create_cache_key
added missing params
added $table_name to cache_query_result
formating
tabs
added $table_name to check_query_cache
unify cache parameters order
`table_name` is more important than `connection_name`
formating
|
|
can't handle it
|
|
|
|
|
|
|
|
|
|
|
|
|
|
where_id_in() for selecting multiple records by primary key
|
|
Multiple OR'ed conditions support
|
|
|
|
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' ));
```
|
|
|
|
|
|
|
|
|
|
|
|
Remove some empty results from the array before checking.
|
|
Updated preg_match_all parameters.
|
|
Changed some debugging code.
|
|
Added some more debug code.
|
|
Added debug code to see why it's failing.
|
|
Fixed the regex not having backslashes escaped.
|
|
Updated regex to disregard placeholders within quotes.
|
|
Fixed regex issue that caused almost all tests to fail.
|
|
Testing:
Checks the parameter array to ensure the correct number of values inside
the parameter with sequential integer indexes.
Production:
Strips out any non-integer indexes from the parameter array inside the
_log_query function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PDOStatement does not have a direct constructor (i.e., __construct). Newing up a PDOStatement or subclass (e.g., MockPDOStatement) does technically work in Zend, but HHVM throws. A correct way to have the code currently structured in bootstrap.php work correctly on both Zend and HHVM is provide a default constructor and execute method in MockPDOStatement. It would probably best long term to avoid newing up a PDOStatement and create the queries another way. But this works for now.
|
|
into develop
|
|
Ignore result columns when calling a aggregate function
|
|
|
|
|
|
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.
|
|
|
|
|