本文整理汇总了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;
}