Modification fonctionnelle + test

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

View File

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

View File

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