HOR-24-3018 "Change error message for REST endpoint..." SOLVED

This commit is contained in:
Luis Fernando Saisa Lopez
2016-01-26 17:37:25 -04:00
parent 88e49b5eee
commit f430be2064

View File

@@ -3,6 +3,26 @@ namespace ProcessMaker\BusinessModel\Cases;
class OutputDocument class OutputDocument
{ {
/**
* Verify exists app_doc_uid in table APP_DOCUMENT when is output
*
* @param string $applicationUid
*
* return void Throw exception output not exists
*/
private function throwExceptionIfNotExistsAppDocument($appDocumentUid)
{
try {
$appDocument = \AppDocumentPeer::retrieveByPK($appDocumentUid, 1);
if (is_null($appDocument)) {
throw new \Exception(\G::LoadTranslation("ID_CASES_OUTPUT_DOES_NOT_EXIST", array($appDocumentUid)));
}
} catch (\Exception $e) {
throw $e;
}
}
/** /**
* Check if the user has permissions * Check if the user has permissions
* *
@@ -26,6 +46,9 @@ class OutputDocument
$flagInbox = 0; $flagInbox = 0;
} }
//Verfiry exists $appDocumentUid
$this->throwExceptionIfNotExistsAppDocument($appDocumentUid);
//Verify data permission //Verify data permission
$flagPermission = 0; $flagPermission = 0;