本文整理匯總了PHP中CakeSchema::build方法的典型用法代碼示例。如果您正苦於以下問題:PHP CakeSchema::build方法的具體用法?PHP CakeSchema::build怎麽用?PHP CakeSchema::build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CakeSchema
的用法示例。
在下文中一共展示了CakeSchema::build方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: build
/**
* Overwritten to change $this->path when it's been specifically given in the first parameter
* CakePHP has a problem where it would override the path if it's a plugin, without checking if it was specified
*/
public function build($data)
{
parent::build($data);
if (!empty($data['path'])) {
$this->path = $data['path'];
}
}
示例2: _schema
/**
* Return CakeSchema object for given Schema name
*
* @return CakeSchema
*/
protected function _schema()
{
if ($this->_Schema) {
return $this->_Schema;
}
$db = ConnectionManager::getDataSource($this->useDbConfig);
$this->_Schema = new CakeSchema(array('connection' => $db));
$this->_Schema->build(array($this->_tableName() => $this->_schema));
Cache::drop('_cake_model_');
$db->cacheSources = false;
$db->reconnect();
return $this->_Schema;
}