本文整理汇总了PHP中OA_Dal::getTablePrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP OA_Dal::getTablePrefix方法的具体用法?PHP OA_Dal::getTablePrefix怎么用?PHP OA_Dal::getTablePrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OA_Dal
的用法示例。
在下文中一共展示了OA_Dal::getTablePrefix方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateAuditContext
/**
* Replaces the existing "context" column in "audit" table with apropriate table names
*
* @return boolean
*/
function updateAuditContext()
{
$tblAudit = $this->oUpgrade->oDbh->quoteIdentifier(OA_Dal::getTablePrefix() . 'audit', true);
foreach ($this->aContexts as $contextOld => $contextNew) {
$query = 'UPDATE ' . $tblAudit . ' SET context = ' . $this->oUpgrade->oDbh->quote($contextNew) . ' WHERE context = ' . $this->oUpgrade->oDbh->quote($contextOld);
$result = $this->oUpgrade->oDbh->exec($query);
if (PEAR::isError($result) || $result === false) {
$this->logError('Error while updating audit context: ' . $result->getUserInfo());
return false;
}
}
$this->logOnly('audit context values updated');
return true;
}
示例2: _addPrefixToTableName
/**
* Add a prefix to table name and save oroginal table name in _tableName
*
* @access private
*/
function _addPrefixToTableName()
{
if (empty($this->_tableName)) {
$this->_prefix = OA_Dal::getTablePrefix();
$this->_tableName = $this->__table;
$this->__table = $this->_prefix . $this->__table;
}
}
示例3: getStatisticsTableName
/**
* Returns the bucket's destination statistics table, that is, the
* table that is defined in the component's plugin to store the
* aggregate bucket data for the components.
*
* @return string The statistics table name with added prefix.
*/
public function getStatisticsTableName()
{
return OA_Dal::getTablePrefix() . $this->getStatisticsName();
}
示例4: testAutoincrementsVsSerial
function testAutoincrementsVsSerial()
{
$prefix = OA_Dal::getTablePrefix();
$oDbh = OA_DB::singleton();
$table = $oDbh->quoteIdentifier($prefix . 'ad_category_assoc');
$sqlInsert = "INSERT INTO {$table} (category_id, ad_id) VALUES (1, 1)";
DBC::execute($sqlInsert);
// Take generated primary key
$doAd_category_assoc = OA_Dal::factoryDO('ad_category_assoc');
$doAd_category_assoc->find($aufetch = true);
$id1 = $doAd_category_assoc->ad_category_assoc_id;
// Now lets generate new record using DataGenerator
$id2 = DataGenerator::generateOne('ad_category_assoc');
// Not only above code should work but also id2 should be equal id1+1
$this->assertEqual($id2, $id1 + 1);
}
示例5: outdateSession
function outdateSession()
{
$sessionId = SESSIONID;
$prefix = OA_Dal::getTablePrefix();
$table = $this->dbh->quoteIdentifier($prefix . 'session');
$this->dbh->exec("UPDATE {$table} set lastused = '2005-01-01 01:00:00' WHERE sessionid = '{$sessionId}'");
}
示例6: getTablePrefix
function getTablePrefix()
{
return OA_Dal::getTablePrefix();
}