本文整理汇总了PHP中ADODB_Active_Record::UpdateActiveTable方法的典型用法代码示例。如果您正苦于以下问题:PHP ADODB_Active_Record::UpdateActiveTable方法的具体用法?PHP ADODB_Active_Record::UpdateActiveTable怎么用?PHP ADODB_Active_Record::UpdateActiveTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADODB_Active_Record
的用法示例。
在下文中一共展示了ADODB_Active_Record::UpdateActiveTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: belongsTo
/**
* ar->foreignName will contain the name of the tables associated with this table because
* this table's rows may also be referenced by those tables using thistable_id or the provided
* foreign keys (this index name is stored in ar->foreignKey)
*
* this-table.other-table_id = other-table.id
*/
function belongsTo($foreignRef, $foreignKey = false)
{
global $inflector;
$ar = new ADODB_Active_Record($this->_pluralize($foreignRef));
$ar->foreignName = $foreignRef;
$ar->UpdateActiveTable();
$ar->foreignKey = $foreignKey ? $foreignKey : $ar->foreignName . self::$_foreignSuffix;
$table =& $this->TableInfo();
if (!isset($table->_belongsTo[$foreignRef])) {
$table->_belongsTo[$foreignRef] = $ar;
$table->updateColsCount();
}
$this->{$foreignRef} = $table->_belongsTo[$foreignRef];
}
示例2: belongsTo
function belongsTo($foreignRef, $foreignKey = false, $parentKey = '')
{
global $inflector;
$ar = new ADODB_Active_Record($this->_pluralize($foreignRef));
$ar->foreignName = $foreignRef;
$ar->parentKey = $parentKey;
$ar->UpdateActiveTable();
$ar->foreignKey = $foreignKey ? $foreignKey : $foreignRef . ADODB_Active_Record::$_foreignSuffix;
$table =& $this->TableInfo();
$table->_belongsTo[$foreignRef] = $ar;
# $this->$foreignRef = $this->_belongsTo[$foreignRef];
}