本文整理汇总了PHP中xmldb_table::setChanged方法的典型用法代码示例。如果您正苦于以下问题:PHP xmldb_table::setChanged方法的具体用法?PHP xmldb_table::setChanged怎么用?PHP xmldb_table::setChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmldb_table
的用法示例。
在下文中一共展示了xmldb_table::setChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTable
/**
* Add one table to the structure, allowing to specify the desired order
* If it's not specified, then the table is added at the end.
* @param xmldb_table $table
* @param mixed $after
*/
public function addTable($table, $after = null)
{
// Calculate the previous and next tables
$prevtable = null;
$nexttable = null;
if (!$after) {
if ($this->tables) {
end($this->tables);
$prevtable = $this->tables[key($this->tables)];
}
} else {
$prevtable = $this->getTable($after);
}
if ($prevtable && $prevtable->getNext()) {
$nexttable = $this->getTable($prevtable->getNext());
}
// Set current table previous and next attributes
if ($prevtable) {
$table->setPrevious($prevtable->getName());
$prevtable->setNext($table->getName());
}
if ($nexttable) {
$table->setNext($nexttable->getName());
$nexttable->setPrevious($table->getName());
}
// Some more attributes
$table->setLoaded(true);
$table->setChanged(true);
// Add the new table
$this->tables[] = $table;
// Reorder the whole structure
$this->orderTables($this->tables);
// Recalculate the hash
$this->calculateHash(true);
// We have one new table, so the structure has changed
$this->setVersion(userdate(time(), '%Y%m%d', 99, false));
$this->setChanged(true);
}