Correction modele + comment
This commit is contained in:
parent
fcf190a852
commit
05e4a31fe1
10
automate.php
10
automate.php
|
@ -76,7 +76,7 @@
|
|||
$requete = new manager\ModuleRequest('userDefaultModule/getAll');
|
||||
$answer = $requete->dispatch();
|
||||
|
||||
// var_dump( $answer->serialize() );
|
||||
var_dump( \manager\ManagerError::explicit($answer->error) );
|
||||
var_dump( $answer->get('users') );
|
||||
|
||||
return true;
|
||||
|
@ -100,12 +100,12 @@
|
|||
|
||||
// Creation de la requete
|
||||
$request = new \manager\ModuleRequest('firstModule/getUsers');
|
||||
|
||||
$answer = $request->dispatch();
|
||||
// Debug error
|
||||
var_dump( $request->error );
|
||||
var_dump( \manager\ManagerError::explicit($request->error) );
|
||||
var_dump( $answer->error );
|
||||
var_dump( \manager\ManagerError::explicit($answer->error) );
|
||||
|
||||
$users = $request->dispatch()->get('users');
|
||||
$users = $answer->get('users');
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -56,15 +56,21 @@
|
|||
|
||||
// On recupere tous les utilisateurs
|
||||
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 'Liste des utilisateurs: <br>';
|
||||
|
||||
// si erreur, on affiche l'explicitation
|
||||
if( $answer->error != \manager\ManagerError::Success )
|
||||
var_dump( \manager\ManagerError::explicit($answer->error) );
|
||||
|
||||
// Si aucune erreur, on affiche les resultats
|
||||
else
|
||||
var_dump( $answer->get('users') );
|
||||
|
||||
echo '</section>';
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue