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 9dc24f4627
commit 4d09388155
5 changed files with 27 additions and 17 deletions

View File

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

View File

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

View File

@ -14,7 +14,7 @@
case 'cluster': return " case 'cluster': return "
<span> <span>
@name @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>"; </span>";
break; break;

View File

@ -14,7 +14,7 @@
case 'cluster': return " case 'cluster': return "
<span> <span>
@name @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>"; </span>";
break; break;

View File

@ -436,17 +436,27 @@
// var_dump($myUser); // var_dump($myUser);
// $module = Table::get('module') $module = Table::get('module')
// ->select('id_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') // $a->dispatch();
// ->whereId(7);
//
// $module_merge = Table::get('module_merge')
// ->join('id_module', $module)
// ->join('id_warehouse', $warehouse);
//
// var_dump($module_merge->fetch(false));
?> ?>