本文整理匯總了PHP中Doctrine_Connection::addTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Connection::addTable方法的具體用法?PHP Doctrine_Connection::addTable怎麽用?PHP Doctrine_Connection::addTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine_Connection
的用法示例。
在下文中一共展示了Doctrine_Connection::addTable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* the constructor
*
* @throws Doctrine_Connection_Exception if there are no opened connections
* @param string $name the name of the component
* @param Doctrine_Connection $conn the connection associated with this table
* @param boolean $initDefinition whether to init the in-memory schema
*/
public function __construct($name, Doctrine_Connection $conn, $initDefinition = false)
{
$this->_conn = $conn;
$this->_options['name'] = $name;
$this->setParent($this->_conn);
$this->_conn->addTable($this);
$this->_parser = new Doctrine_Relation_Parser($this);
if ($charset = $this->getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_CHARSET)) {
$this->_options['charset'] = $charset;
}
if ($collate = $this->getAttribute(Doctrine_Core::ATTR_DEFAULT_TABLE_COLLATE)) {
$this->_options['collate'] = $collate;
}
if ($initDefinition) {
$this->record = $this->initDefinition();
$this->initIdentifier();
$this->record->setUp();
// if tree, set up tree
if ($this->isTree()) {
$this->getTree()->setUp();
}
} else {
if (!isset($this->_options['tableName'])) {
$this->setTableName(Doctrine_Inflector::tableize($this->_options['name']));
}
}
$this->_filters[] = new Doctrine_Record_Filter_Standard();
$this->_repository = new Doctrine_Table_Repository($this);
$this->construct();
}