Modification fonctionnelle + test
This commit is contained in:
parent
571bb432f6
commit
e026bc0cc1
|
@ -10,6 +10,7 @@
|
|||
|
||||
/* CONSTANTES */
|
||||
const COND_EQUAL = '=';
|
||||
const COND_NOTEQ = '<>';
|
||||
const COND_INF = '<';
|
||||
const COND_SUP = '>';
|
||||
const COND_INFEQ = '<=';
|
||||
|
|
|
@ -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']
|
||||
]);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue