2016-07-02 15:10:41 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
2016-02-04 18:23:16 +00:00
|
|
|
require_once __ROOT__.'/manager/autoloader.php';
|
|
|
|
|
2016-02-14 11:37:19 +00:00
|
|
|
use \manager\ModuleRequest;
|
2016-07-06 15:36:26 +00:00
|
|
|
use \manager\sessionManager;
|
2016-02-14 11:37:19 +00:00
|
|
|
use \manager\ResourceDispatcher;
|
|
|
|
use \manager\ManagerError;
|
|
|
|
use \manager\Repo;
|
2016-07-02 15:46:59 +00:00
|
|
|
use \manager\Database;
|
2016-07-21 20:05:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
use \manager\ORM\Table;
|
|
|
|
use \manager\ORM\Rows;
|
2016-07-21 19:12:53 +00:00
|
|
|
use \manager\ORM\Row;
|
2016-07-24 10:00:49 +00:00
|
|
|
use \manager\ORM\SQLBuilder;
|
2016-02-14 11:37:19 +00:00
|
|
|
|
2016-02-13 17:41:19 +00:00
|
|
|
debug();
|
2016-02-04 18:23:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-04 09:04:49 +00:00
|
|
|
/* INSERTION DES UTILISATEURS DANS LA BDD DEPUIS JSON
|
2016-02-04 18:23:16 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function insertUsersFromJSON(){
|
2016-07-09 13:06:59 +00:00
|
|
|
$json = file_get_contents(__ROOT__.'/config/generated_users.json');
|
2016-02-04 18:23:16 +00:00
|
|
|
$json = json_decode( $json, true );
|
|
|
|
|
|
|
|
// Pour chaque entree
|
|
|
|
foreach( $json as $user ){
|
|
|
|
|
2016-02-14 12:55:06 +00:00
|
|
|
// Creation de la requete
|
2016-07-04 13:45:29 +00:00
|
|
|
$request = new ModuleRequest('userDefault/create', [
|
2016-07-09 13:06:59 +00:00
|
|
|
'code' => $user['code'],
|
|
|
|
'username' => $user['username'],
|
|
|
|
'firstname' => $user['firstname'],
|
|
|
|
'lastname' => $user['lastname'],
|
|
|
|
'mail' => $user['email'],
|
|
|
|
'password' => $user['password'],
|
|
|
|
'status' => $user['status']
|
2016-07-04 13:45:29 +00:00
|
|
|
]);
|
2016-02-14 12:55:06 +00:00
|
|
|
$answer = $request->dispatch();
|
2016-07-09 13:06:59 +00:00
|
|
|
|
2016-02-14 12:55:06 +00:00
|
|
|
// Debug error
|
2016-07-09 13:06:59 +00:00
|
|
|
if( $answer->error != ManagerError::Success )
|
|
|
|
var_dump( $answer->error );
|
2016-02-04 18:23:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-14 13:16:47 +00:00
|
|
|
}//insertUsersFromJSON();
|
2016-02-04 18:23:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-10 07:54:23 +00:00
|
|
|
/* NSERTION DES MACHINES DANS LA BDD DEPUIS JSON
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function insertMachinesFromJSON(){
|
2016-07-09 13:06:59 +00:00
|
|
|
$json = file_get_contents(__ROOT__.'/config/generated_machines.json');
|
2016-02-10 07:54:23 +00:00
|
|
|
$json = json_decode( $json, true );
|
|
|
|
|
|
|
|
// Pour chaque entree
|
|
|
|
foreach( $json as $machine ){
|
|
|
|
|
2016-02-14 13:16:47 +00:00
|
|
|
// Creation de la requete
|
2016-07-04 13:45:29 +00:00
|
|
|
$request = new ModuleRequest('machineDefault/create', [
|
2016-07-09 13:06:59 +00:00
|
|
|
'name' => $machine['name']
|
2016-07-04 13:45:29 +00:00
|
|
|
]);
|
2016-02-14 13:16:47 +00:00
|
|
|
$answer = $request->dispatch();
|
2016-07-09 13:06:59 +00:00
|
|
|
|
2016-02-14 13:16:47 +00:00
|
|
|
// Debug error
|
2016-07-09 13:06:59 +00:00
|
|
|
if( $answer->error != ManagerError::Success )
|
|
|
|
var_dump( $answer->error );
|
2016-02-10 07:54:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-14 14:17:26 +00:00
|
|
|
}//insertMachinesFromJSON();
|
2016-02-10 07:54:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 18:23:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 19:21:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* AFFICHAGE DES UTILISATEURS DE LA BDD
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function selectUsers(){
|
|
|
|
|
|
|
|
// Creation de la requete
|
2016-02-14 11:37:19 +00:00
|
|
|
$requete = new ModuleRequest('userDefault/getAll');
|
2016-02-04 23:07:03 +00:00
|
|
|
$answer = $requete->dispatch();
|
2016-02-04 19:21:01 +00:00
|
|
|
|
2016-02-14 11:37:19 +00:00
|
|
|
var_dump( ManagerError::explicit($answer->error) );
|
2016-02-05 07:54:21 +00:00
|
|
|
var_dump( $answer->get('users') );
|
2016-02-04 20:15:43 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-10 07:54:23 +00:00
|
|
|
}//selectUsers();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* AFFICHAGE DES MACHINES DE LA BDD
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function selectMachines(){
|
|
|
|
|
|
|
|
// Creation de la requete
|
2016-02-14 11:37:19 +00:00
|
|
|
$requete = new ModuleRequest('machineDefault/getAll');
|
2016-02-10 07:54:23 +00:00
|
|
|
$answer = $requete->dispatch();
|
|
|
|
|
2016-02-14 11:37:19 +00:00
|
|
|
var_dump( ManagerError::explicit($answer->error) );
|
2016-02-10 07:54:23 +00:00
|
|
|
var_dump( $answer->get('machines') );
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-11 09:34:26 +00:00
|
|
|
}//selectMachines();
|
2016-02-04 20:15:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 19:21:01 +00:00
|
|
|
|
|
|
|
|
2016-02-04 20:15:43 +00:00
|
|
|
|
|
|
|
/* AFFICHAGE DES UTILISATEURS DE LA BDD (MIS EN PAGE)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function displayUsers(){
|
|
|
|
|
|
|
|
// Creation de la requete
|
2016-02-14 11:37:19 +00:00
|
|
|
$request = new ModuleRequest('userDefault/getAll');
|
2016-02-05 08:18:01 +00:00
|
|
|
$answer = $request->dispatch();
|
2016-02-04 23:07:03 +00:00
|
|
|
|
2016-02-11 15:00:41 +00:00
|
|
|
// Debug error
|
2016-02-14 11:37:19 +00:00
|
|
|
if( $answer->error != ManagerError::Success )
|
|
|
|
var_dump( ManagerError::explicit($answer->error) );
|
2016-02-04 20:15:43 +00:00
|
|
|
|
2016-02-11 15:00:41 +00:00
|
|
|
// display result
|
|
|
|
var_dump( $answer->getAll() );
|
2016-02-04 19:21:01 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-04 23:07:03 +00:00
|
|
|
}//displayUsers();
|
2016-02-04 19:21:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-02-04 18:23:16 +00:00
|
|
|
/* TEST DU DISPATCHER DES MANAGERS
|
|
|
|
*
|
|
|
|
* @return nomRetour<typeRetour> Description du retour
|
2016-07-02 15:10:41 +00:00
|
|
|
|
2016-02-04 18:23:16 +00:00
|
|
|
*/
|
|
|
|
function testModuleDispatcher(){
|
|
|
|
|
2016-02-04 19:21:01 +00:00
|
|
|
// Creation d'une requete en objet
|
2016-07-04 13:45:29 +00:00
|
|
|
$req1 = new ModuleRequest('firstModule/returnvar', ['id_user' => 10, 'code' => '11-22-33-44'] );
|
2016-02-04 19:21:01 +00:00
|
|
|
// Creation d'une requete a partir d'un json en <String>
|
2016-02-14 11:37:19 +00:00
|
|
|
$req2 = ModuleRequest::fromString('{"path": "firstModule/returnvar", "data": {"id_user":10, "code":"11-22-33-44"}}');
|
2016-02-04 18:23:16 +00:00
|
|
|
|
2016-02-04 20:15:43 +00:00
|
|
|
var_dump( $req1->dispatch() );
|
2016-02-04 18:23:16 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-04 20:15:43 +00:00
|
|
|
}//testModuleDispatcher();
|
2016-02-04 18:23:16 +00:00
|
|
|
|
|
|
|
|
2016-02-11 09:34:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* TEST DU DISPATCHER DES REPO
|
|
|
|
*
|
|
|
|
* @return nomRetour<typeRetour> Description du retour
|
2016-07-02 15:10:41 +00:00
|
|
|
|
2016-02-11 09:34:26 +00:00
|
|
|
*/
|
|
|
|
function testRepoDispatcher(){
|
|
|
|
|
|
|
|
// Creation d'une requete en objet
|
2016-07-04 13:45:29 +00:00
|
|
|
$req1 = new Repo('user/getById', ['19']);
|
2016-02-14 11:37:19 +00:00
|
|
|
// $req1 = new Repo('user/getByCode', array('92-55-B9-B3'));
|
2016-02-11 09:34:26 +00:00
|
|
|
var_dump( $req1->answer() );
|
|
|
|
|
2016-02-14 11:37:19 +00:00
|
|
|
if( $req1->error != ManagerError::Success )
|
|
|
|
var_dump( ManagerError::explicit($req1->error) );
|
2016-02-11 09:34:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-11 15:00:41 +00:00
|
|
|
}//testRepoDispatcher();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* INSERTION (COMPOSITE) DES UTILISATEURS DE LA BDD
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function insertUsersComposite(){
|
|
|
|
|
|
|
|
// Creation de la requete
|
2016-07-04 13:45:29 +00:00
|
|
|
$request = new ModuleRequest('userDefault/create', ['92-55-B9-B1', 'b', 'bla', 'bla', 'bla@test.com', 'sadas', '1'] );
|
2016-02-11 15:00:41 +00:00
|
|
|
$answer = $request->dispatch();
|
|
|
|
// Debug error
|
2016-02-14 11:37:19 +00:00
|
|
|
if( $answer->error != ManagerError::Success )
|
|
|
|
var_dump( ManagerError::explicit($answer->error) );
|
2016-02-11 15:00:41 +00:00
|
|
|
|
|
|
|
var_dump( $answer->getAll() );
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-14 12:28:35 +00:00
|
|
|
}//insertUsersComposite();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* RETOURNE LES GROUPES D'UN UTILISATEUR
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function getUserClusters(){
|
|
|
|
$id_user = 115;
|
|
|
|
|
|
|
|
// Groupes de l'utilisateur 'a'
|
2016-07-04 13:45:29 +00:00
|
|
|
$getUser1Clusters = new Repo('user/getClusters', [$id_user]);
|
2016-02-14 12:28:35 +00:00
|
|
|
$user1Clusters = $getUser1Clusters->answer();
|
|
|
|
var_dump( $user1Clusters );
|
|
|
|
|
|
|
|
// On ajoute un groupe a l'utilisateur 100
|
|
|
|
$linkA = new Repo('cluster/link', array($user1Clusters[0]['id_cluster'], 100) );
|
|
|
|
var_dump( $linkA->answer() );
|
|
|
|
$getUser2Clusters = new Repo('user/getClusters', array(100));
|
|
|
|
var_dump( $getUser2Clusters->answer() );
|
|
|
|
|
|
|
|
// On retire un groupe a l'utilisateur 100
|
|
|
|
$unlinkA = new Repo('cluster/unlink', array($user1Clusters[0]['id_cluster'], 100) );
|
|
|
|
var_dump( $linkA->answer() );
|
|
|
|
$getUser2Clusters = new Repo('user/getClusters', array(100));
|
|
|
|
var_dump( $getUser2Clusters->answer() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}//getUserClusters();
|
2016-02-14 14:53:59 +00:00
|
|
|
|
|
|
|
|
2016-02-16 08:03:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* MODIFICATION D'UN UTILISATEUR
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return status<Boolean> TRUE si aucune erreur, sinon FALSE
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function editUser(){
|
|
|
|
$id_user = 48;
|
|
|
|
|
|
|
|
$request = new ModuleRequest('userDefault/edit', array(
|
|
|
|
'B1-87-EA-BF',
|
|
|
|
'Abigail',
|
|
|
|
'Mcmillan',
|
|
|
|
'Savage',
|
|
|
|
'mcmillansavage@corecom.com',
|
|
|
|
'password',
|
|
|
|
0
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
// ["B1-87-EA-BF","Abigail01","Mcmillan","Savage","mcmillansavage@corecom.com","password",0]
|
|
|
|
|
|
|
|
var_dump( $request->dispatch() );
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
2016-02-16 08:35:37 +00:00
|
|
|
}//editUser();
|
2016-02-16 08:03:12 +00:00
|
|
|
|
2016-07-02 15:46:59 +00:00
|
|
|
|
2016-02-16 23:15:47 +00:00
|
|
|
// new ResourceDispatcher('f/svg/search/st/sub-menu-side/ff0000', true);
|
2016-02-16 22:42:07 +00:00
|
|
|
|
2016-07-02 15:46:59 +00:00
|
|
|
|
|
|
|
|
2016-07-04 12:39:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
function createWarehouse(){
|
|
|
|
|
2016-07-04 15:44:21 +00:00
|
|
|
$insert = new Repo('admin/create', [
|
|
|
|
'FirstAdmin',
|
|
|
|
'adminmail@gmail.com',
|
|
|
|
'AdminPassword'
|
|
|
|
]);
|
2016-07-04 12:39:27 +00:00
|
|
|
var_dump( $insert->answer() );
|
|
|
|
|
|
|
|
|
2016-07-04 15:44:21 +00:00
|
|
|
$getAll = new Repo('admin/getAll');
|
2016-07-06 15:36:26 +00:00
|
|
|
}//createWarehouse();
|
2016-07-02 15:46:59 +00:00
|
|
|
|
2016-07-15 15:53:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-11 15:44:18 +00:00
|
|
|
debug();
|
|
|
|
|
2016-07-23 13:53:51 +00:00
|
|
|
/* [1] FETCH
|
|
|
|
=========================================================*/
|
2016-07-24 22:26:58 +00:00
|
|
|
// $warehouse =
|
|
|
|
// Table::get('warehouse') // Table : WAREHOUSE
|
|
|
|
// ->whereName(['stef-montauban', Rows::COND_EQUAL]) // condition : name = 'stef-montauban'
|
|
|
|
// ->select('name') // select : warehouse.name
|
|
|
|
// ->unique(); // limit : 1
|
|
|
|
//
|
|
|
|
// $myUser =
|
|
|
|
// Table::get('user') // Table : USER
|
|
|
|
// ->whereId([100, Rows::COND_INF]) // condition : clé primaire(id_user) < 100
|
|
|
|
// ->whereId([[94, 95, 96], Rows::COND_IN]) // condition : clé primaire(id_user) parmi les valeurs [94, 95, 96]
|
|
|
|
// ->whereUsername(['%e%', Rows::COND_LIKE]) // condition : username LIKE '%e%'
|
|
|
|
// ->select('name') // Select : user.id_user
|
|
|
|
// ->select('id_user', Rows::SEL_COUNT)
|
|
|
|
// ->join('id_warehouse', $warehouse) // jointure la table WAREHOUSE (automatique, soit référence, soit primaire soit même référence)
|
|
|
|
//
|
|
|
|
// // SELECT
|
|
|
|
// ->fetch();
|
|
|
|
// var_dump($myUser);
|
2016-07-24 16:23:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
// SELECT user.firstname, user.mail, user.username, user.id_user, warehouse.name
|
|
|
|
// FROM user, (SELECT warehouse.* FROM warehouse WHERE warehouse.name = :warehouse_x_name_0 ) as warehouse
|
|
|
|
// WHERE user.id_user < :user_x_id_user_0
|
|
|
|
// AND user.id_user IN (:user_x_id_user_1_0, :user_x_id_user_1_1)
|
|
|
|
// AND user.username LIKE :user_x_username_2
|
|
|
|
// AND user.id_warehouse = warehouse.id_warehouse
|
2016-07-24 16:11:46 +00:00
|
|
|
//
|
2016-07-24 16:23:09 +00:00
|
|
|
// LIMIT 1;
|
2016-07-23 10:33:05 +00:00
|
|
|
|
2016-07-23 13:53:51 +00:00
|
|
|
/* [2] Modification
|
|
|
|
=========================================================*/
|
|
|
|
// $warehouse =
|
|
|
|
// Table::get('warehouse') // Access to table 'warehouse'
|
|
|
|
// ->whereName(['stef-montauban', Rows::COND_NOTEQ]); // condition : name = 'my-warehouse'
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// $myUser =
|
2016-07-24 10:31:54 +00:00
|
|
|
// Table::get('user') // Access to table 'user'
|
|
|
|
// ->whereId([100, Rows::COND_INF]) // PRIMARY KEY (other condition on same field)
|
|
|
|
// ->whereId([[1,4,6,9], Rows::COND_IN]) // PRIMARY KEY (other condition on same field)
|
|
|
|
// ->whereUsername(['%e%', 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
|
|
|
|
//
|
|
|
|
// // ->fetch();
|
|
|
|
// ->edit([
|
|
|
|
// 'id_warehouse' => Table::get('warehouse')->whereName(['stef-montauban', Rows::COND_EQUAL])->unique()->select('id_warehouse')->fetch()['id_warehouse']
|
|
|
|
// ]);
|
2016-07-23 13:53:51 +00:00
|
|
|
|
2016-07-24 10:31:54 +00:00
|
|
|
// var_dump($myUser);
|
2016-07-23 13:53:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* [3] INSERTION
|
|
|
|
=========================================================*/
|
|
|
|
// $insert = Table::get('user')
|
|
|
|
// ->insert([
|
|
|
|
// [
|
2016-07-24 17:18:55 +00:00
|
|
|
// 'id_user' => Rows::INSERT_DEFAULT,
|
2016-07-23 13:53:51 +00:00
|
|
|
// 'id_warehouse' => 7,
|
|
|
|
// 'code' => 'AA-AA-AA-AA',
|
|
|
|
// 'username' => 'AA',
|
|
|
|
// 'firstname' => 'AA',
|
|
|
|
// 'lastname' => 'AA',
|
|
|
|
// 'mail' => 'AA@AA.AA'
|
|
|
|
// ],
|
|
|
|
// [
|
2016-07-24 17:18:55 +00:00
|
|
|
// 'id_user' => Rows::INSERT_DEFAULT,
|
2016-07-23 13:53:51 +00:00
|
|
|
// 'id_warehouse' => 7,
|
|
|
|
// 'code' => 'BB-BB-BB-BB',
|
|
|
|
// 'username' => 'BB',
|
|
|
|
// 'firstname' => 'BB',
|
|
|
|
// 'lastname' => 'BB',
|
|
|
|
// 'mail' => 'BB@BB.BB'
|
|
|
|
// ]
|
|
|
|
// ]);
|
|
|
|
|
|
|
|
|
|
|
|
/* [4] Suppression
|
|
|
|
=========================================================*/
|
2016-07-23 14:36:58 +00:00
|
|
|
// $warehouse =
|
|
|
|
// Table::get('warehouse') // Access to table 'warehouse'
|
2016-07-24 13:24:54 +00:00
|
|
|
// ->whereName(['%stef%', Rows::COND_LIKE]) // condition : name = 'my-warehouse'
|
|
|
|
// ->select('id_warehouse');
|
2016-07-23 14:36:58 +00:00
|
|
|
//
|
|
|
|
//
|
|
|
|
// $myUser =
|
|
|
|
// Table::get('user') // Access to table 'user'
|
2016-07-24 13:24:54 +00:00
|
|
|
// ->whereId([[7,91], Rows::COND_IN]) // PRIMARY KEY (other condition on same field)
|
|
|
|
// ->whereUsername(['%', Rows::COND_LIKE]) // Dynamic getter 'getByMySuperColumn' -> 'my_super_column'
|
2016-07-23 14:36:58 +00:00
|
|
|
// ->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'
|
2016-07-24 13:24:54 +00:00
|
|
|
// ->unique() // unique result
|
2016-07-23 14:36:58 +00:00
|
|
|
//
|
|
|
|
// ->delete();
|
2016-07-24 10:34:55 +00:00
|
|
|
|
2016-07-24 13:24:54 +00:00
|
|
|
// var_dump($myUser);
|
2016-07-24 10:34:55 +00:00
|
|
|
|
2016-07-24 23:14:35 +00:00
|
|
|
$module_merge = Table::get('module_merge')
|
|
|
|
->whereIdWarehouse(7);
|
2016-07-24 10:34:55 +00:00
|
|
|
|
2016-07-24 13:35:00 +00:00
|
|
|
|
2016-07-24 23:14:35 +00:00
|
|
|
$chip = Table::get('chip')
|
|
|
|
->join('id_module', $module_merge)
|
2016-07-24 22:55:42 +00:00
|
|
|
->select('*');
|
|
|
|
|
2016-07-24 23:14:35 +00:00
|
|
|
var_dump($chip->fetch());
|
2016-07-24 22:55:42 +00:00
|
|
|
|
2016-07-24 13:35:00 +00:00
|
|
|
|
|
|
|
// $a = new ModuleRequest('authentificationDefault/warehouse', [
|
|
|
|
// 'name' => 'test',
|
|
|
|
// 'password' => 'slk'
|
|
|
|
// ]);
|
2016-07-24 13:24:54 +00:00
|
|
|
//
|
2016-07-24 13:35:00 +00:00
|
|
|
// $a->dispatch();
|
|
|
|
|
|
|
|
|
2016-07-23 14:36:58 +00:00
|
|
|
|
|
|
|
|
2016-07-02 15:10:41 +00:00
|
|
|
?>
|