mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
fixing issue with bake reading tables
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4468 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
90b0f1f1cc
commit
7754dbd284
1 changed files with 3 additions and 3 deletions
|
@ -422,18 +422,18 @@ class Bake {
|
|||
while($tableIsGood == false && low($useTable) != 'null') {
|
||||
$db =& ConnectionManager::getDataSource($useDbConfig);
|
||||
$fullTableName = $db->fullTableName($useTable, false);
|
||||
$sources = $db->listSources();
|
||||
if (is_array($sources) && !in_array(low($fullTableName), array_map('low', $sources))) {
|
||||
if (is_array($this->__tables) && !in_array($fullTableName, $this->__tables)) {
|
||||
$this->stdout($fullTableName . ' does not exist.');
|
||||
$useTable = $this->getInput('What is the name of the table (enter "null" to use NO table)?');
|
||||
$tableIsGood = false;
|
||||
} else {
|
||||
$useTable = $fullTableName;
|
||||
$tableIsGood = true;
|
||||
}
|
||||
}
|
||||
$wannaDoValidation = $this->getInput('Would you like to supply validation criteria for the fields in your model?', array('y','n'), 'y');
|
||||
|
||||
if(array_search($useTable, $this->__tables)) {
|
||||
if(in_array($useTable, $this->__tables)) {
|
||||
loadModel();
|
||||
$tempModel = new Model(false, $useTable);
|
||||
$db =& ConnectionManager::getDataSource($useDbConfig);
|
||||
|
|
Loading…
Reference in a new issue