From 4b65b371bc575e3f4812db3953b6ccc031c1e8fd Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 24 Jul 2016 15:35:00 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20:=20les=20'link'=20et=20'unlink'?= =?UTF-8?q?=20des=20'machines'/'utilisateurs'=20avaient=20des=20pb=20suite?= =?UTF-8?q?=20=C3=A0=20l'implantation=20de=20l'ORM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/repo/chip.php | 2 +- manager/repo/machine_cluster.php | 8 ++++---- manager/view/machine/view.php | 2 +- manager/view/user/view.php | 2 +- test/automate.php | 30 ++++++++++++++++++++---------- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/manager/repo/chip.php b/manager/repo/chip.php index 8d86e61..54017dd 100644 --- a/manager/repo/chip.php +++ b/manager/repo/chip.php @@ -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 diff --git a/manager/repo/machine_cluster.php b/manager/repo/machine_cluster.php index 03aec74..cfa51cd 100644 --- a/manager/repo/machine_cluster.php +++ b/manager/repo/machine_cluster.php @@ -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(); diff --git a/manager/view/machine/view.php b/manager/view/machine/view.php index 6afe917..2428012 100644 --- a/manager/view/machine/view.php +++ b/manager/view/machine/view.php @@ -14,7 +14,7 @@ case 'cluster': return " @name - + "; break; diff --git a/manager/view/user/view.php b/manager/view/user/view.php index beb9607..8c47f88 100644 --- a/manager/view/user/view.php +++ b/manager/view/user/view.php @@ -14,7 +14,7 @@ case 'cluster': return " @name - + "; break; diff --git a/test/automate.php b/test/automate.php index 76bdec3..bfa7657 100755 --- a/test/automate.php +++ b/test/automate.php @@ -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(); + + ?>