ErrorManagement Class Introduction

This commit is contained in:
EoleDev 2016-02-12 12:45:00 +01:00
parent af451ad442
commit 294fbb4d11
4 changed files with 100 additions and 7 deletions

View file

@ -9,7 +9,7 @@
*
* @todo Complete the functions and finish the descriptions
*/
use OpenStack\Common\Error;
/**
* Identity Class of the back-end application
@ -59,6 +59,25 @@ class identity implements Core{
*/
$credentials["addCredential"] = function(){
$blob = $this->app->getPostParam("blob");
$projectId = $this->app->getPostParam("projectId");
$type = $this->app->getPostParam("type");
$userId = $this->app->getPostParam("userId");
if(!isset($blob) || !isset($projectId) || !isset($type) || !isset($userId)){
$this->app->setOutput("Error", "Parameters Incorrect");
}
try{
$opt = array('blob' => $blob, 'projectId' => $projectId, 'type' => $type, 'userId' => $userId);
$res = $this->libClass->createCredential($opt);
}catch(Exception $e){
}
]
}
@ -82,7 +101,8 @@ class identity implements Core{
* @return void
*/
$credentials["showCredential"] = function(){
$credential = $identity->getCredential('credentialId');
$credential->retrieve();
}
@ -94,7 +114,12 @@ class identity implements Core{
* @return void
*/
$credentials["updateCredential"] = function(){
$credential = $identity->getCredential('credentialId');
$credential->type = 'foo';
$credential->blob = 'bar';
$credential->update();
}
@ -106,7 +131,8 @@ class identity implements Core{
* @return void
*/
$credentials["deleteCredential"] = function(){
$credential = $identity->getCredential('credentialId');
$credential->delete();
}