Adicion en importacion
This commit is contained in:
@@ -16,4 +16,52 @@ require_once 'classes/model/om/BaseProcessVariables.php';
|
||||
*/
|
||||
class ProcessVariables extends BaseProcessVariables {
|
||||
|
||||
public function create ($aData)
|
||||
{
|
||||
$con = Propel::getConnection( ProcessVariablesPeer::DATABASE_NAME );
|
||||
try {
|
||||
$this->fromArray( $aData, 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);
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($sVarUid)
|
||||
{
|
||||
$oConnection = Propel::getConnection(ProcessVariablesPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oProcessVariables = ProcessVariablesPeer::retrieveByPK($sVarUid);
|
||||
if (!is_null($oProcessVariables)) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oProcessVariables->delete();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
} else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function Exists ($sVarUid)
|
||||
{
|
||||
try {
|
||||
$oObj = ProcessVariablesPeer::retrieveByPk($sVarUid);
|
||||
return (is_object($oObj) && get_class($oObj) == 'ProcessVariables');
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
} // ProcessVariables
|
||||
|
||||
Reference in New Issue
Block a user