本文整理汇总了PHP中G::generateUniqueID方法的典型用法代码示例。如果您正苦于以下问题:PHP G::generateUniqueID方法的具体用法?PHP G::generateUniqueID怎么用?PHP G::generateUniqueID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::generateUniqueID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create($aData)
{
$oConnection = Propel::getConnection(RoutePeer::DATABASE_NAME);
try {
$sRouteUID = G::generateUniqueID();
$aData['ROU_UID'] = $sRouteUID;
$oRoute = new Route();
// validating default values
$aData['ROU_TO_LAST_USER'] = $this->validateValue(isset($aData['ROU_TO_LAST_USER']) ? $aData['ROU_TO_LAST_USER'] : '', array('TRUE', 'FALSE'), 'FALSE');
$aData['ROU_OPTIONAL'] = $this->validateValue(isset($aData['ROU_OPTIONAL']) ? $aData['ROU_OPTIONAL'] : '', array('TRUE', 'FALSE'), 'FALSE');
$aData['ROU_SEND_EMAIL'] = $this->validateValue(isset($aData['ROU_SEND_EMAIL']) ? $aData['ROU_SEND_EMAIL'] : '', array('TRUE', 'FALSE'), 'TRUE');
$oRoute->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oRoute->validate()) {
$oConnection->begin();
$iResult = $oRoute->save();
$oConnection->commit();
return $sRouteUID;
} else {
$sMessage = '';
$aValidationFailures = $oRoute->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be created!<br />' . $sMessage);
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例2: create
public function create($aData)
{
$oConnection = Propel::getConnection(StagePeer::DATABASE_NAME);
try {
if (isset($aData['STG_UID']) && $aData['STG_UID'] == '') {
unset($aData['STG_UID']);
}
if (!isset($aData['STG_UID'])) {
$aData['STG_UID'] = G::generateUniqueID();
}
$oStage = new Stage();
$oStage->fromArray($aData, BasePeer::TYPE_FIELDNAME);
$oStage->setStgTitle($aData['STG_TITLE']);
if ($oStage->validate()) {
$oConnection->begin();
$iResult = $oStage->save();
$oConnection->commit();
return $aData['STG_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oStage->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be created!<br />' . $sMessage);
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例3: create
public function create($aData)
{
$oConnection = Propel::getConnection(GatewayPeer::DATABASE_NAME);
try {
$sGatewayUID = G::generateUniqueID();
$aData['GAT_UID'] = $sGatewayUID;
$oGateway = new Gateway();
$oGateway->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oGateway->validate()) {
$oConnection->begin();
$iResult = $oGateway->save();
$oConnection->commit();
return $sGatewayUID;
} else {
$sMessage = '';
$aValidationFailures = $oGateway->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be created!<br />' . $sMessage);
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例4: createOrUpdate
public function createOrUpdate(array $arrayData)
{
$cnn = Propel::getConnection(NotificationDevicePeer::DATABASE_NAME);
try {
if (!isset($arrayData['DEV_UID'])) {
$arrayData['DEV_UID'] = G::generateUniqueID();
$arrayData['DEV_CREATE'] = date('Y-m-d H:i:s');
$arrayData['DEV_UPDATE'] = date('Y-m-d H:i:s');
$mNotification = new NotificationDevice();
} else {
$arrayData['DEV_UPDATE'] = date('Y-m-d H:i:s');
$mNotification = NotificationDevicePeer::retrieveByPK($arrayData['DEV_UID'],$arrayData['USR_UID']);
}
$mNotification->fromArray($arrayData, BasePeer::TYPE_FIELDNAME);
if ($mNotification->validate()) {
$cnn->begin();
$result = $mNotification->save();
$cnn->commit();
} else {
throw new Exception(G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED"));
}
} catch (Exception $e) {
$cnn->rollback();
throw $e;
}
return isset($arrayData['DEV_UID']) ? $arrayData['DEV_UID'] : 0;
}
示例5: create
function create($aData)
{
if (!isset($aData['AUTH_SOURCE_UID'])) {
$aData['AUTH_SOURCE_UID'] = G::generateUniqueID();
} else {
if ($aData['AUTH_SOURCE_UID'] == '') {
$aData['AUTH_SOURCE_UID'] = G::generateUniqueID();
}
}
$aData['AUTH_SOURCE_DATA'] = is_array($aData['AUTH_SOURCE_DATA']) ? serialize($aData['AUTH_SOURCE_DATA']) : $aData['AUTH_SOURCE_DATA'];
$oConnection = Propel::getConnection(AuthenticationSourcePeer::DATABASE_NAME);
try {
$oAuthenticationSource = new AuthenticationSource();
$oAuthenticationSource->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAuthenticationSource->validate()) {
$oConnection->begin();
$iResult = $oAuthenticationSource->save();
$oConnection->commit();
return $aData['AUTH_SOURCE_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oAuthenticationSource->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be created!<br />' . $sMessage);
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例6: create
function create($aData)
{
try {
$sCode = $aData['PER_CODE'];
$oCriteria = new Criteria('rbac');
$oCriteria->add(PermissionsPeer::PER_CODE, $sCode);
$oDataset = PermissionsPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if (is_array($aRow)) {
return 1;
}
$aData['PER_UID'] = G::generateUniqueID();
$aData['PER_CODE'] = $aData['PER_CODE'];
$aData['PER_CREATE_DATE'] = date('Y-m-d H:i:s');
$aData['PER_UPDATE_DATE'] = $aData['PER_CREATE_DATE'];
$aData['PER_STATUS'] = 1;
$oPermission = new Permissions();
$oPermission->fromArray($aData, BasePeer::TYPE_FIELDNAME);
$iResult = $oPermission->save();
return $aData['PER_UID'];
} catch (Exception $oError) {
throw $oError;
}
}
示例7: create
public function create($arrayData)
{
$cnn = Propel::getConnection(OauthClientsPeer::DATABASE_NAME);
try {
$cnn->begin();
$id = G::generateCode(32, "ALPHA");
$secret = G::generateUniqueID();
$this->setClientId($id);
$this->setClientSecret($secret);
$this->setClientName($arrayData["CLIENT_NAME"]);
$this->setClientDescription($arrayData["CLIENT_DESCRIPTION"]);
$this->setClientWebsite($arrayData["CLIENT_WEBSITE"]);
$this->setRedirectUri($arrayData["REDIRECT_URI"]);
$this->setUsrUid($arrayData["USR_UID"]);
if ($this->validate()) {
$result = $this->save();
$cnn->commit();
return array("CLIENT_ID" => $id, "CLIENT_SECRET" => $secret);
} else {
$cnn->rollback();
throw new Exception("Failed Validation in class \"" . get_class($this) . "\".");
}
} catch (Exception $e) {
$cnn->rollback();
throw $e;
}
}
示例8: create
/**
* Create the application document registry
* @param array $aData
* @return string
**/
public function create($aData)
{
$oConnection = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
try {
$aData['SWI_UID'] = G::generateUniqueID();
$oSwimlanesElements = new SwimlanesElements();
$oSwimlanesElements->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oSwimlanesElements->validate()) {
$oConnection->begin();
if (isset($aData['SWI_TEXT'])) {
$oSwimlanesElements->setSwiEleText($aData['SWI_TEXT']);
}
$iResult = $oSwimlanesElements->save();
$oConnection->commit();
return $aData['SWI_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oSwimlanesElements->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be created!<br />' . $sMessage);
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例9: create
function create($aData)
{
$con = Propel::getConnection(StepPeer::DATABASE_NAME);
try {
if (isset($aData['STEP_UID']) && $aData['STEP_UID'] == '') {
unset($aData['STEP_UID']);
}
if (isset($aData['STEP_UID'])) {
$sStepUID = $aData['STEP_UID'];
} else {
$sStepUID = G::generateUniqueID();
}
$con->begin();
$this->setStepUid($sStepUID);
$this->setProUid($aData['PRO_UID']);
$this->setTasUid($aData['TAS_UID']);
if (isset($aData['STEP_TYPE_OBJ'])) {
$this->setStepTypeObj($aData['STEP_TYPE_OBJ']);
} else {
$this->setStepTypeObj("DYNAFORM");
}
if (isset($aData['STEP_UID_OBJ'])) {
$this->setStepUidObj($aData['STEP_UID_OBJ']);
} else {
$this->setStepUidObj("");
}
if (isset($aData['STEP_CONDITION'])) {
$this->setStepCondition($aData['STEP_CONDITION']);
} else {
$this->setStepCondition("");
}
if (isset($aData['STEP_POSITION'])) {
$this->setStepPosition($aData['STEP_POSITION']);
} else {
$this->setStepPosition("");
}
if (isset($aData['STEP_MODE'])) {
$this->setStepMode($aData['STEP_MODE']);
} else {
$this->setStepMode("");
}
if ($this->validate()) {
$result = $this->save();
$con->commit();
return $sStepUID;
} else {
$con->rollback();
throw new Exception("Failed Validation in class " . get_class($this) . ".");
}
} catch (Exception $e) {
$con->rollback();
throw $e;
}
}
示例10: createOrUpdate
public function createOrUpdate($data)
{
$additionalFields = array();
foreach ($data as $field => $value) {
if (!in_array($field, $this->filterThisFields)) {
$additionalFields[$field] = $value;
unset($data[$field]);
}
}
if (!empty($additionalFields)) {
$data['DAS_INS_ADDITIONAL_PROPERTIES'] = serialize($additionalFields);
} else {
$data['DAS_INS_ADDITIONAL_PROPERTIES'] = '';
}
$connection = Propel::getConnection(DashletInstancePeer::DATABASE_NAME);
try {
if (!isset($data['DAS_INS_UID'])) {
$data['DAS_INS_UID'] = '';
}
if ($data['DAS_INS_UID'] == '') {
$data['DAS_INS_UID'] = G::generateUniqueID();
$data['DAS_INS_CREATE_DATE'] = date('Y-m-d H:i:s');
$dashletInstance = new DashletInstance();
$msg = 'CreateDashletInstance';
} else {
$dashletInstance = DashletInstancePeer::retrieveByPK($data['DAS_INS_UID']);
$msg = 'UpdateDashletInstance';
}
$data['DAS_INS_UPDATE_DATE'] = date('Y-m-d H:i:s');
$dashletInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($dashletInstance->validate()) {
$connection->begin();
$result = $dashletInstance->save();
$connection->commit();
$dashletData = $this->load($data['DAS_INS_UID']);
G::auditLog($msg, "Dashlet Instance Name: " . $dashletData['DAS_INS_TITLE'] . " Dashlet Instance ID: (" . $dashletData['DAS_INS_UID'] . ") ");
return $data['DAS_INS_UID'];
} else {
$message = '';
$validationFailures = $dashletInstance->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw new Exception('Error trying to update: ' . $message);
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
示例11: createOrUpdate
public function createOrUpdate($data)
{
foreach ($data as $field => $value) {
if (!in_array($field, $this->filterThisFields)) {
unset($data[$field]);
}
}
$connection = Propel::getConnection(AbeConfigurationPeer::DATABASE_NAME);
try {
if (!isset($data['ABE_UID'])) {
$data['ABE_UID'] = '';
}
if ($data['ABE_UID'] == '') {
$data['ABE_UID'] = G::generateUniqueID();
$data['ABE_CREATE_DATE'] = date('Y-m-d H:i:s');
$abeConfigurationInstance = new AbeConfiguration();
} else {
$abeConfigurationInstance = AbeConfigurationPeer::retrieveByPK($data['ABE_UID']);
}
$data['ABE_UPDATE_DATE'] = date('Y-m-d H:i:s');
$abeConfigurationInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
if ($abeConfigurationInstance->validate()) {
$connection->begin();
$result = $abeConfigurationInstance->save();
$connection->commit();
return $data['ABE_UID'];
} else {
$message = '';
$validationFailures = $abeConfigurationInstance->getValidationFailures();
foreach ($validationFailures as $validationFailure) {
$message .= $validationFailure->getMessage() . '. ';
}
throw (new Exception('Error trying to update: ' . $message));
}
} catch (Exception $error) {
$connection->rollback();
throw $error;
}
}
示例12: saveLogParameters
public function saveLogParameters($params)
{
if (isset($params['LOG_CASE_UID']) && $params['LOG_CASE_UID'] == '') {
unset($params['LOG_CASE_UID']);
}
if (!isset($params['LOG_CASE_UID'])) {
$params['LOG_CASE_UID'] = G::generateUniqueID();
}
$this->setLogCaseUid($params['LOG_CASE_UID']);
$this->setProUid($params['PRO_UID']);
$this->setTasUid($params['TAS_UID']);
$this->setSchUid($params['SCH_UID']);
$this->setUsrName($params['USR_NAME']);
$this->setExecDate($params['EXEC_DATE']);
$this->setExecHour($params['EXEC_HOUR']);
$this->setResult($params['RESULT']);
$this->setWsCreateCaseStatus($params['WS_CREATE_CASE_STATUS']);
$this->setWsRouteCaseStatus($params['WS_ROUTE_CASE_STATUS']);
}
示例13: create
function create($aData)
{
if (!isset($aData['AUTH_SOURCE_UID'])) {
$aData['AUTH_SOURCE_UID'] = G::generateUniqueID();
} else {
if ($aData['AUTH_SOURCE_UID'] == '') {
$aData['AUTH_SOURCE_UID'] = G::generateUniqueID();
}
}
$aData['AUTH_SOURCE_DATA'] = is_array($aData['AUTH_SOURCE_DATA']) ? serialize($aData['AUTH_SOURCE_DATA']) : $aData['AUTH_SOURCE_DATA'];
$oConnection = Propel::getConnection(AuthenticationSourcePeer::DATABASE_NAME);
try {
$oAuthenticationSource = new AuthenticationSource();
$oAuthenticationSource->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oAuthenticationSource->validate()) {
$oConnection->begin();
$iResult = $oAuthenticationSource->save();
$oConnection->commit();
$authSourceServerName = isset($aData['AUTH_SOURCE_SERVER_NAME']) ? ' - Server Name: ' . $aData['AUTH_SOURCE_SERVER_NAME'] : '';
$authSourcePort = isset($aData['AUTH_SOURCE_PORT']) ? ' - Port: ' . $aData['AUTH_SOURCE_PORT'] : '';
$authSourceEnabledTLS = isset($aData['AUTH_SOURCE_ENABLED_TLS']) ? ' - TLS: ' . $aData['AUTH_SOURCE_ENABLED_TLS'] : '';
$authSourceVersion = isset($aData['AUTH_SOURCE_VERSION']) ? ' - Version: ' . $aData['AUTH_SOURCE_VERSION'] : '';
$authSourceBaseDn = isset($aData['AUTH_SOURCE_BASE_DN']) ? ' - BaseDN: ' . $aData['AUTH_SOURCE_BASE_DN'] : '';
$authAnonymous = $aData['AUTH_ANONYMOUS'] == 1 ? ' - Anonymous: YES' : ' - Anonymous: NO';
$authSourceSearchUser = isset($aData['AUTH_SOURCE_SEARCH_USER']) ? ' - Search User: ' . $aData['AUTH_SOURCE_SEARCH_USER'] : '';
$authSourceLdapType = isset($aData['AUTH_SOURCE_DATA']['LDAP_TYPE']) ? ' - LDAP type: ' . $aData['AUTH_SOURCE_DATA']['LDAP_TYPE'] : '';
$authSourceIdentifier = isset($aData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER']) ? ' - Identifier: ' . $aData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'] : '';
$authSourceFilter = isset($aData['AUTH_SOURCE_DATA']['AUTH_SOURCE_ADDITIONAL_FILTER']) ? ' - Aditional Filter: ' . $aData['AUTH_SOURCE_DATA']['AUTH_SOURCE_ADDITIONAL_FILTER'] : '';
G::auditLog("CreateAuthSource", "Authentication Source Name: " . $aData['AUTH_SOURCE_NAME'] . " - Authentication Source ID: (" . $aData['AUTH_SOURCE_UID'] . ") " . $authSourceServerName . $authSourcePort . $authSourceEnabledTLS . $authSourceVersion . $authSourceBaseDn . $authAnonymous . $authSourceSearchUser . $authSourceLdapType . $authSourceIdentifier . $authSourceFilter);
return $aData['AUTH_SOURCE_UID'];
} else {
$sMessage = '';
$aValidationFailures = $oAuthenticationSource->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw new Exception('The registry cannot be created!<br />' . $sMessage);
}
} catch (Exception $oError) {
$oConnection->rollback();
throw $oError;
}
}
示例14: quickSave2
/**
* AppMessgae quick Save method
*
* @param Array(msg_uid, app_uid, del_index, app_msg_type, app_msg_subject, app_msg_from, app_msg_to,
* app_msg_body, app_msg_cc, app_msg_bcc, app_msg_attach, app_msg_template, app_msg_status )
*
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmai.com>
* Date Aug 31th, 2009
*/
public function quickSave2($data_spool)
{
$this->data_spool = $data_spool;
$sUID = G::generateUniqueID();
$spool = new AppMessage();
$spool->setAppMsgUid($sUID);
$spool->setMsgUid($data_spool['msg_uid']);
$spool->setAppUid($data_spool['app_uid']);
$spool->setDelIndex($data_spool['del_index']);
$spool->setAppMsgType($data_spool['app_msg_type']);
$spool->setAppMsgSubject($data_spool['app_msg_subject']);
$spool->setAppMsgFrom($data_spool['app_msg_from']);
$spool->setAppMsgTo($data_spool['app_msg_to']);
$spool->setAppMsgBody($data_spool['app_msg_body']);
$spool->setAppMsgDate(date('Y-m-d H:i:s'));
$spool->setAppMsgCc($data_spool['app_msg_cc']);
$spool->setAppMsgBcc($data_spool['app_msg_bcc']);
$spool->setappMsgAttach($data_spool['app_msg_attach']);
$spool->setAppMsgTemplate($data_spool['app_msg_template']);
$spool->setAppMsgStatus($data_spool['app_msg_status']);
$spool->setAppMsgError($data_spool['app_msg_error']);
if (!$spool->validate()) {
$this->error_spool = $spool->getValidationFailures();
$this->status_spool = 'error';
$error_msg = "AppMessage::quickSave(): Validation error: \n";
foreach ($errors as $key => $value) {
$error_msg .= $value->getMessage($key) . "\n";
}
throw new Exception($error_msg);
} else {
//echo "Saving - validation ok\n";
$this->error_spool = '';
$this->status = 'success';
$spool->save();
}
return $sUID;
}
示例15: create
public function create($aData)
{
$con = Propel::getConnection(SubProcessPeer::DATABASE_NAME);
try {
$con->begin();
if (isset($aData['SP_UID']) && $aData['SP_UID'] == '') {
unset($aData['SP_UID']);
}
if (!isset($aData['SP_UID'])) {
$this->setSpUid(G::generateUniqueID());
} else {
$this->setSpUid($aData['SP_UID']);
}
$this->setProUid($aData['PRO_UID']);
$this->setTasUid($aData['TAS_UID']);
$this->setProParent($aData['PRO_PARENT']);
$this->setTasParent($aData['TAS_PARENT']);
$this->setSpType($aData['SP_TYPE']);
$this->setSpSynchronous($aData['SP_SYNCHRONOUS']);
$this->setSpSynchronousType($aData['SP_SYNCHRONOUS_TYPE']);
$this->setSpSynchronousWait($aData['SP_SYNCHRONOUS_WAIT']);
$this->setSpVariablesOut($aData['SP_VARIABLES_OUT']);
$this->setSpVariablesIn($aData['SP_VARIABLES_IN']);
$this->setSpGridIn($aData['SP_GRID_IN']);
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;
}
}