Correction : les 'link' et 'unlink' des 'machines'/'utilisateurs' avaient des pb suite à l'implantation de l'ORM

This commit is contained in:
xdrm-brackets 2016-07-24 15:35:00 +02:00
parent f078dde920
commit 4b65b371bc
5 changed files with 27 additions and 17 deletions

View File

@ -29,7 +29,7 @@
$module_merge = Table::get('module_merge')
->join('id_module', $module);
var_dump($module_merge->fetch());
// var_dump($module_merge->fetch());
/* [2] On retourne le résultat

View File

@ -149,7 +149,7 @@
$get_merge_id = self::getMerge($id_warehouse, $id_machine_cluster, $id_machine);
/* (2) Si on ne trouve rien */
if( $get_merge_id == false )
if( $get_merge_id === false )
return ManagerError::NoMatchFound;
@ -167,7 +167,7 @@
/* [2] On verifie que l'association n'existe plus
=========================================================*/
if( self::getMerge($id_warehouse, $id_machine_cluster, $id_machine) !== false )
return ManagerError::ModuleError;
return ManagerError::RepoError;
return ManagerError::Success;
@ -194,8 +194,8 @@
=========================================================*/
$cluster_merge = Table::get('machine_cluster_merge')
->whereIdWarehouse($id_warehouse)
->whereIdUserCluster($id_machine_cluster)
->whereIdUser($id_machine)
->whereIdMachineCluster($id_machine_cluster)
->whereIdMachine($id_machine)
->select('*')
->unique()
->fetch();

View File

@ -14,7 +14,7 @@
case 'cluster': return "
<span>
@name
<span class='rem-group' data-group='@id_cluster' data-machine='@id_machine'></span>
<span class='rem-group' data-group='@id_machine_cluster' data-machine='@id_machine'></span>
</span>";
break;

View File

@ -14,7 +14,7 @@
case 'cluster': return "
<span>
@name
<span class='rem-group' data-group='@id_cluster' data-user='@id_user'></span>
<span class='rem-group' data-group='@id_user_cluster' data-user='@id_user'></span>
</span>";
break;

View File

@ -436,17 +436,27 @@
// var_dump($myUser);
// $module = Table::get('module')
// ->select('id_module');
$module = Table::get('module')
->select('id_module');
$warehouse = Table::get('warehouse')
->whereId(7);
$module_merge = Table::get('module_merge')
->join('id_module', $module)
->join('id_warehouse', $warehouse);
var_dump($module_merge->fetch(false));
// $a = new ModuleRequest('authentificationDefault/warehouse', [
// 'name' => 'test',
// 'password' => 'slk'
// ]);
//
// $warehouse = Table::get('warehouse')
// ->whereId(7);
//
// $module_merge = Table::get('module_merge')
// ->join('id_module', $module)
// ->join('id_warehouse', $warehouse);
//
// var_dump($module_merge->fetch(false));
// $a->dispatch();
?>