Modification fonctionnelle + test

This commit is contained in:
xdrm-brackets 2016-07-23 12:07:13 +02:00
parent 4c0e2e284a
commit a4798f635b
2 changed files with 7 additions and 7 deletions

View File

@ -10,6 +10,7 @@
/* CONSTANTES */
const COND_EQUAL = '=';
const COND_NOTEQ = '<>';
const COND_INF = '<';
const COND_SUP = '>';
const COND_INFEQ = '<=';

View File

@ -344,16 +344,15 @@
$warehouse =
Table::get('warehouse') // Access to table 'warehouse'
->whereName(['s%', Rows::COND_LIKE]); // condition : name = 'my-warehouse'
->whereName(['stef-montauban', Rows::COND_NOTEQ]); // condition : name = 'my-warehouse'
$myUser =
Table::get('user') // Access to table 'user'
->whereId([3, Rows::COND_INF]) // PRIMARY KEY (if composed, all arguments in array)
// ->whereId([100, Rows::COND_INF]) // PRIMARY KEY (other condition on same field)
// ->whereUsername(['jo%', Rows::COND_LIKE]) // Dynamic getter 'getByMySuperColumn' -> 'my_super_column'
// ->select(['mail', 'username', 'firstname']) // Select clause
// ->select('id_user') // Select clause (added)
->whereId([100, Rows::COND_INF]) // PRIMARY KEY (other condition on same field)
->whereUsername(['jo%', Rows::COND_LIKE]) // Dynamic getter 'getByMySuperColumn' -> 'my_super_column'
->select(['mail', 'username', 'firstname']) // Select clause
->select('id_user') // Select clause (added)
->join('id_warehouse', $warehouse) // joins warehouse (with name 'my-warehouse') to column 'id_warehouse'
// ->unique() // unique result
@ -363,7 +362,7 @@
// UPDATE
->edit([
'id_warehouse' => '8'
'id_warehouse' => Table::get('warehouse')->whereName('stef-montauban')->unique()->select('id_warehouse')->fetch()['id_warehouse']
]);