mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-11 19:20:01 +08:00
Relaxed access level for yii\gii\generators\model\Generator
This commit is contained in:
@@ -508,16 +508,16 @@ class Generator extends \yii\gii\Generator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private $_tableNames;
|
protected $tableNames;
|
||||||
private $_classNames;
|
protected $classNames;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array the table names that match the pattern specified by [[tableName]].
|
* @return array the table names that match the pattern specified by [[tableName]].
|
||||||
*/
|
*/
|
||||||
protected function getTableNames()
|
protected function getTableNames()
|
||||||
{
|
{
|
||||||
if ($this->_tableNames !== null) {
|
if ($this->tableNames !== null) {
|
||||||
return $this->_tableNames;
|
return $this->tableNames;
|
||||||
}
|
}
|
||||||
$db = $this->getDbConnection();
|
$db = $this->getDbConnection();
|
||||||
if ($db === null) {
|
if ($db === null) {
|
||||||
@@ -540,10 +540,10 @@ class Generator extends \yii\gii\Generator
|
|||||||
}
|
}
|
||||||
} elseif (($table = $db->getTableSchema($this->tableName, true)) !== null) {
|
} elseif (($table = $db->getTableSchema($this->tableName, true)) !== null) {
|
||||||
$tableNames[] = $this->tableName;
|
$tableNames[] = $this->tableName;
|
||||||
$this->_classNames[$this->tableName] = $this->modelClass;
|
$this->classNames[$this->tableName] = $this->modelClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_tableNames = $tableNames;
|
return $this->tableNames = $tableNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -574,8 +574,8 @@ class Generator extends \yii\gii\Generator
|
|||||||
*/
|
*/
|
||||||
protected function generateClassName($tableName)
|
protected function generateClassName($tableName)
|
||||||
{
|
{
|
||||||
if (isset($this->_classNames[$tableName])) {
|
if (isset($this->classNames[$tableName])) {
|
||||||
return $this->_classNames[$tableName];
|
return $this->classNames[$tableName];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($pos = strrpos($tableName, '.')) !== false) {
|
if (($pos = strrpos($tableName, '.')) !== false) {
|
||||||
@@ -601,7 +601,7 @@ class Generator extends \yii\gii\Generator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_classNames[$tableName] = Inflector::id2camel($className, '_');
|
return $this->classNames[$tableName] = Inflector::id2camel($className, '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user