本文整理汇总了PHP中BizSystem::Configuration方法的典型用法代码示例。如果您正苦于以下问题:PHP BizSystem::Configuration方法的具体用法?PHP BizSystem::Configuration怎么用?PHP BizSystem::Configuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BizSystem
的用法示例。
在下文中一共展示了BizSystem::Configuration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateId
/**
* Generate Id according to the IdGeneration attribute
*
* @param boolean $isBeforeInsert
* @param string $tableName
* @param string $idCloumnName
* @return long|string|boolean
*/
protected function generateId($isBeforeInsert = true, $tableName = null, $idCloumnName = null)
{
// Identity type id is generated after insert is done.
// If this method is called before insert, return null.
if ($isBeforeInsert && $this->m_IdGeneration == 'Identity') {
return null;
}
if (!$isBeforeInsert && $this->m_IdGeneration != 'Identity') {
$this->m_ErrorMessage = BizSystem::getMessage("DATA_UNABLE_GET_ID", $this->m_Name);
return false;
}
/* @var $genIdService genIdService */
$genIdService = BizSystem::getService(GENID_SERVICE);
$db = $this->getDBConnection();
$dbInfo = BizSystem::Configuration()->getDatabaseInfo($this->m_Database);
$dbType = $dbInfo["Driver"];
$table = $tableName ? $tableName : $this->m_MainTable;
$column = $idCloumnName ? $idCloumnName : $this->getField("Id")->m_Column;
try {
$newId = $genIdService->getNewID($this->m_IdGeneration, $db, $dbType, $table, $column);
} catch (Exception $e) {
$this->m_ErrorMessage = $e->getMessage();
return false;
}
return $newId;
}