Correction modele + comment

This commit is contained in:
xdrm-brackets 2016-02-05 09:18:01 +01:00
parent 540c97b390
commit ce00453a1d
2 changed files with 13 additions and 7 deletions

View File

@ -76,7 +76,7 @@
$requete = new manager\ModuleRequest('userDefaultModule/getAll'); $requete = new manager\ModuleRequest('userDefaultModule/getAll');
$answer = $requete->dispatch(); $answer = $requete->dispatch();
// var_dump( $answer->serialize() ); var_dump( \manager\ManagerError::explicit($answer->error) );
var_dump( $answer->get('users') ); var_dump( $answer->get('users') );
return true; return true;
@ -100,12 +100,12 @@
// Creation de la requete // Creation de la requete
$request = new \manager\ModuleRequest('firstModule/getUsers'); $request = new \manager\ModuleRequest('firstModule/getUsers');
$answer = $request->dispatch();
// Debug error // Debug error
var_dump( $request->error ); var_dump( $answer->error );
var_dump( \manager\ManagerError::explicit($request->error) ); var_dump( \manager\ManagerError::explicit($answer->error) );
$users = $request->dispatch()->get('users'); $users = $answer->get('users');

View File

@ -56,15 +56,21 @@
// On recupere tous les utilisateurs // On recupere tous les utilisateurs
debug(); debug();
$request = new \manager\ModuleRequest('userDefaultModule/getAll');
$answer = $request->dispatch(); $request = new \manager\ModuleRequest('userDefaultModule/getAll'); // On utilise la methode 'getAll' du module 'userDefaultModule'
$answer = $request->dispatch(); // On recupere la reponse
echo '<section>'; echo '<section>';
echo 'Liste des utilisateurs: <br>'; echo 'Liste des utilisateurs: <br>';
// si erreur, on affiche l'explicitation
if( $answer->error != \manager\ManagerError::Success ) if( $answer->error != \manager\ManagerError::Success )
var_dump( \manager\ManagerError::explicit($answer->error) ); var_dump( \manager\ManagerError::explicit($answer->error) );
// Si aucune erreur, on affiche les resultats
else else
var_dump( $answer->get('users') ); var_dump( $answer->get('users') );
echo '</section>'; echo '</section>';
} }