本文整理汇总了PHP中RowManager::createNewEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP RowManager::createNewEntry方法的具体用法?PHP RowManager::createNewEntry怎么用?PHP RowManager::createNewEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RowManager
的用法示例。
在下文中一共展示了RowManager::createNewEntry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createNewEntry
/**
* function createNewEntry
* <pre>
* Creates a new table entry in the DB for this object to manage.
* </pre>
* @param $doAllowPrimaryKeyUpdate [BOOL] allow insertion of primary key
* value if present.
* @return [void]
*/
function createNewEntry($doAllowPrimaryKeyUpdate = false)
{
parent::createNewEntry($doAllowPrimaryKeyUpdate);
if ($this->isVolumePriceRule() == true) {
// create a record for tracking whether a volume rule is active
$activeRule = new RowManager_ActiveRuleManager($this->getID());
$setRecord = array();
$setRecord['pricerules_id'] = $this->getID();
$setRecord['is_active'] = RowManager_ActiveRuleManager::IS_FALSE;
// default value
$setRecord['is_recalculated'] = RowManager_ActiveRuleManager::IS_TRUE;
// default value
$activeRule->loadFromArray($setRecord);
$activeRule->createNewEntry(true);
}
}
示例2: createNewEntry
/**
* function createNewEntry
* <pre>
* Creates a new table entry in the DB for this object to manage.
* </pre>
* @param $doAllowPrimaryKeyUpdate [BOOL] allow insertion of primary key
* value if present.
* @return [void]
*/
function createNewEntry($doAllowPrimaryKeyUpdate = false)
{
parent::createNewEntry($doAllowPrimaryKeyUpdate);
//$ccTransID = $this->getID();
$values = $this->getArrayOfValues();
// echo "<pre>".print_r($values,true)."</pre>";
if (isset($values['reg_id'])) {
// update balance owing column in cim_reg_registration table
$singleReg = new RowManager_RegistrationManager($values['reg_id']);
// $singleReg_list = $singleReg->getListIterator();
// $singleReg_array = $singleReg_list->getDataList();
//
// reset($singleReg_array);
// $record = current($singleReg_array);
// $oldBalance = $record['registration_balance'];
$balanceGetter = new FinancialTools();
$balance = array();
// $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];
$balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);
$singleReg->loadFromArray($balance);
$singleReg->updateDBTable();
}
}
示例3: createNewEntry
/**
* function createNewEntry
* <pre>
* Creates a new row entry in the DB table for this object to manage. It
* also updates the Xlation tabel to mark the new entry as needing
* translation.
* </pre>
* @param $doAllowPrimaryKeyUpdate [BOOL] allow insertion of primary key
* @param $shouldIgnoreXlation [BOOL] allow insertion of primary key
* value if present.
* @return [void]
*/
function createNewEntry($doAllowPrimaryKeyUpdate = false, $shouldIgnoreXlation = false)
{
// make sure label is translated into UnicodeEntities
$data = $this->getLabel();
$newData = Unicode_utf8ToUnicodeEntities($data);
$this->setLabel($newData);
parent::createNewEntry($doAllowPrimaryKeyUpdate);
if (!$shouldIgnoreXlation) {
$currentPageID = $this->getPageID();
$currentKey = $this->getKey();
$currentLanguageID = $this->getLanguageID();
$xlationManager = new RowManager_XLationManager();
// If there are no other pageID + labelKey entries like this one
// then we need to add xlation entries for all other languages.
$condition = 'page_id=' . $currentPageID;
if ($this->isUniqueFieldValue($currentKey, 'label_key', $condition)) {
$xlationManager->setLabelID($this->getID());
// for each other language in site
$languageManager = new RowManager_LanguageManager();
$languageList = $languageManager->getListIterator();
$languageList->setFirst();
while ($language = $languageList->getNext()) {
$newLanguageID = $language->getID();
if ($newLanguageID != $currentLanguageID) {
// Add Xlation Entry
$xlationManager->setLanguageID($newLanguageID);
$xlationManager->createNewEntry();
}
}
// next language
} else {
// Since there are other label id's, then look to see
// if the current entry can substitute for an xlation request
// for each label with matching PageID & Key
$labelManager = new RowManager_MultilingualLabelManager();
$labelManager->setPageID($currentPageID);
$labelManager->setKey($currentKey);
$labelList = $labelManager->getListIterator();
$labelList->setFirst();
while ($label = $labelList->getNext()) {
// delete any xlation entry with current language_id &
// matching label_id
if ($xlationManager->loadByLabelAndLanguage($label->getID(), $currentLanguageID)) {
$xlationManager->deleteEntry();
}
}
// next label
}
// end if isUnique
}
// end if !shouldIgnoreXlation
}