Se adiciona la funcion throwExceptionIfNotExistsVariable para verificar la existencia de la variable en process_variables
This commit is contained in:
@@ -153,7 +153,6 @@ class Variable
|
||||
Validator::proUid($processUid, '$prj_uid');
|
||||
|
||||
$this->throwExceptionIfNotExistsVariable($variableUid);
|
||||
|
||||
//Delete
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
@@ -480,5 +479,25 @@ class Variable
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if does not exist the variable in table PROCESS_VARIABLES
|
||||
*
|
||||
* @param string $variableUid Unique id of variable
|
||||
*
|
||||
* return void Throw exception if does not exist the variable in table PROCESS_VARIABLES
|
||||
*/
|
||||
public function throwExceptionIfNotExistsVariable($variableUid)
|
||||
{
|
||||
try {
|
||||
$obj = \ProcessVariablesPeer::retrieveByPK($variableUid);
|
||||
|
||||
if (is_null($obj)) {
|
||||
throw new \Exception('var_uid: '.$variableUid. ' '.\G::LoadTranslation("ID_DOES_NOT_EXIST"));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user