-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an element to warn users about the use of auto-tables
- Loading branch information
Showing
6 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP(tm) Project | ||
* @since 3.0.0 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
use Cake\ORM\TableRegistry; | ||
$autoTables = TableRegistry::genericInstances(); | ||
if (!$autoTables) { | ||
return; | ||
} | ||
?> | ||
<h3>Could this be caused by using Auto-Tables?</h3> | ||
<p> | ||
Some of the Table objects in your application were created by instantiating "<strong>Cake\ORM\Table</strong>" | ||
instead of any other specific subclass. | ||
</p> | ||
<p>This could be the cause for this exception. Auto-Tables are created for you under the following circumstances:</p> | ||
<ul> | ||
<li>The class for the specified table does not exist.</li> | ||
<li>The Table was created with a typo: <strong><em>TableRegistry::get('Atricles');</em></strong></li> | ||
<li>The class file has a typo in the name or incorrect namespace: <strong><em>class Atricles extends Table</em></strong></li> | ||
<li>The file containing the class has a typo or incorrect casing: <strong><em>Atricles.php</em></strong></li> | ||
<li>The Table was used using associations but the association has a typo: <strong><em>$this->belongsTo('Atricles')</em></strong></li> | ||
<li>The table class resides in a Plugin but <strong><em>no plugin notation</em></strong> was used in the association definition.</li> | ||
</ul> | ||
<br/> | ||
<p>Please try correcting the issue for the following table aliases:</p> | ||
<ul> | ||
<?php foreach ($autoTables as $alias => $table) : ?> | ||
<li><strong><?= $alias ?></strong></li> | ||
<?php endforeach; ?> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters