I solved the issue PM-1649 ./processmaker migrate-new-cases-lists

This commit is contained in:
Paula V. Quispe
2015-03-04 18:42:47 -04:00
parent f4a65aa184
commit 1f497cc6f6
10 changed files with 500 additions and 7 deletions

View File

@@ -15,5 +15,95 @@ require_once 'classes/model/om/BaseListUnassignedGroup.php';
* @package classes.model
*/
class ListUnassignedGroup extends BaseListUnassignedGroup {
/**
* Create List Unassigned Group Table
*
* @param type $data
* @return type
*
*/
public function create($data)
{
$con = Propel::getConnection( ListUnassignedGroupPeer::DATABASE_NAME );
try {
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$result = $this->save();
} else {
$e = new Exception( "Failed Validation in class " . get_class( $this ) . "." );
$e->aValidationFailures = $this->getValidationFailures();
throw ($e);
}
$con->commit();
return $result;
} catch(Exception $e) {
$con->rollback();
throw ($e);
}
}
/**
* Update List Unassigned Group Table
*
* @param type $data
* @return type
* @throws type
*/
public function update($data)
{
$con = Propel::getConnection( ListUnassignedGroupPeer::DATABASE_NAME );
try {
$con->begin();
$this->setNew( false );
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$result = $this->save();
$con->commit();
return $result;
} else {
$con->rollback();
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
/**
* Remove List Unassigned Group
*
* @param type $seqName
* @return type
* @throws type
*
*/
public function remove ($app_uid,$una_uid)
{
$con = Propel::getConnection( ListUnassignedGroupPeer::DATABASE_NAME );
try {
$this->setAppUid($app_uid);
$this->setUnaUid($una_uid);
$con->begin();
$this->delete();
$con->commit();
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
/**
* newRow List Unassigned Group
*
* @param type $seqName
* @return type
* @throws type
*
*/
public function newRow($unaUid, $usrUid, $type, $typeUid=''){
$data['UNA_UID'] = $unaUid;
$data['USR_UID'] = $usrUid;
$data['TYPE'] = $type;
$data['TYP_UID'] = $typeUid;
self::create($data);
}
} // ListUnassignedGroup