/** * Validate Process Uid * @var string $pro_uid. Uid for process * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * * @return string */ public function validateProUid($pro_uid) { $pro_uid = trim($pro_uid); if ($pro_uid == '') { throw new \Exception(\G::LoadTranslation("ID_PROJECT_NOT_EXIST", array('prj_uid', ''))); } $oProcess = new \Process(); if (!$oProcess->processExists($pro_uid)) { throw new \Exception(\G::LoadTranslation("ID_PROJECT_NOT_EXIST", array('prj_uid', $pro_uid))); } return $pro_uid; }
/** * Validate Process Uid * @var string $pro_uid. Uid for process * * @author Brayan Pereyra (Cochalo) <*****@*****.**> * @copyright Colosa - Bolivia * * @return string */ public function validateProUid($pro_uid) { $pro_uid = trim($pro_uid); if ($pro_uid == '') { throw new \Exception("The project with prj_uid: '', does not exist."); } $oProcess = new \Process(); if (!$oProcess->processExists($pro_uid)) { throw new \Exception("The project with prj_uid: '{$pro_uid}', does not exist."); } return $pro_uid; }
/** * Verify if doesn't exists the Process in table PROCESS * * @param string $processUid Unique id of Process * @param string $fieldNameForException Field name for the exception * * return void Throw exception if doesn't exists the Process in table PROCESS */ public function throwExceptionIfNotExistsProcess($processUid, $fieldNameForException) { try { $process = new \Process(); if (!$process->processExists($processUid)) { throw new \Exception(\G::LoadTranslation("ID_PROJECT_DOES_NOT_EXIST", array($fieldNameForException, $processUid))); } } catch (\Exception $e) { throw $e; } }