public function remove($SP_UID) { $con = Propel::getConnection(SubProcessPeer::DATABASE_NAME); try { $con->begin(); $oRepTab = SubProcessPeer::retrieveByPK($SP_UID); if (!is_null($oRepTab)) { $result = $oRepTab->delete(); $con->commit(); } return $result; } catch (Exception $e) { $con->rollback(); throw $e; } }
/** * Implementation for 'DELETE' method for Rest API * * @param mixed $spUid Primary key * * @return array $result Returns array within multiple records or a single record depending if * a single selection was requested passing id(s) as param */ protected function delete($spUid) { $conn = Propel::getConnection(SubProcessPeer::DATABASE_NAME); try { $conn->begin(); $obj = SubProcessPeer::retrieveByPK($spUid); if (!is_object($obj)) { throw new RestException(412, 'Record does not exist.'); } $obj->delete(); $conn->commit(); } catch (Exception $e) { $conn->rollback(); throw new RestException(412, $e->getMessage()); } }
/** * Implementation for 'DELETE' method for Rest API * * @param mixed $spUid Primary key * * @return array $result Returns array within multiple records or a single record depending if * a single selection was requested passing id(s) as param */ protected function delete($spUid) { $conn = Propel::getConnection(SubProcessPeer::DATABASE_NAME); try { $conn->begin(); $obj = SubProcessPeer::retrieveByPK($spUid); if (!is_object($obj)) { throw new RestException(412, G::LoadTranslation('ID_RECORD_DOES_NOT_EXIST')); } $obj->delete(); $conn->commit(); } catch (Exception $e) { $conn->rollback(); throw new RestException(412, $e->getMessage()); } }