Arreglo de conflictos
This commit is contained in:
@@ -54,5 +54,11 @@ class ProcessCategory extends BaseProcessCategory
|
||||
$aRow = $dataset->getRow();
|
||||
return $aRow;
|
||||
}
|
||||
|
||||
public function exists ($catUid)
|
||||
{
|
||||
$oProCat = ProcessCategoryPeer::retrieveByPk( $catUid );
|
||||
return (is_object( $oProCat ) && get_class( $oProCat ) == 'ProcessCategory');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,56 @@ class Validator{
|
||||
return $tri_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate pro_uid
|
||||
*
|
||||
* @param string $pro_uid, Uid for process
|
||||
* @param string $nameField . Name of field for message
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static public function proUid($pro_uid, $nameField = 'pro_uid')
|
||||
{
|
||||
$pro_uid = trim($pro_uid);
|
||||
if ($pro_uid == '') {
|
||||
throw (new \Exception("The process with $nameField: '' does not exist."));
|
||||
}
|
||||
$oProcess = new \Process();
|
||||
if (!($oProcess->exists($pro_uid))) {
|
||||
throw (new \Exception("The process with $nameField: '$pro_uid' does not exist."));
|
||||
}
|
||||
return $pro_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate cat_uid
|
||||
*
|
||||
* @param string $cat_uid, Uid for category
|
||||
* @param string $nameField . Name of field for message
|
||||
*
|
||||
* @access public
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static public function catUid($cat_uid, $nameField = 'cat_uid')
|
||||
{
|
||||
$cat_uid = trim($cat_uid);
|
||||
if ($cat_uid == '') {
|
||||
throw (new \Exception("The category with $nameField: '' does not exist."));
|
||||
}
|
||||
$oCategory = new \ProcessCategory();
|
||||
if (!($oCategory->exists($cat_uid))) {
|
||||
throw (new \Exception("The category with $nameField: '$cat_uid' does not exist."));
|
||||
}
|
||||
return $cat_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate date
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user