-
Notifications
You must be signed in to change notification settings - Fork 2.6k
3.x How to disable auto-tables #4779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Anything to change? |
en/development/configuration.rst
Outdated
| Disabling Auto-Tables | ||
| ===================== | ||
|
|
||
| While auto-tables are really useful when quickly creating new applications and baking models, they can be hard to debug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard -> difficult
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please shorten the line lengths.
en/development/configuration.rst
Outdated
|
|
||
| While auto-tables are really useful when quickly creating new applications and baking models, they can be hard to debug. | ||
|
|
||
| You can see if any query was fired of auto-tables when you go to history tab, select a request and then go to the sql tab in DebugKit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"when you go to" -> "on the"
sql -> SQL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reword "of auto-tables"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
automatic tables? dummy table classes? placeholder table classes? generic table classes?
any ideas @lorenzo ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope generic table class is good.
en/development/configuration.rst
Outdated
|
|
||
| You can see if any query was fired of auto-tables when you go to history tab, select a request and then go to the sql tab in DebugKit. | ||
|
|
||
| If that is not sufficient, you can throw an exeception if CakePHP is working on ``Cake\ORM\Table``, aka with auto-tables instead of ``App\ORM\YourConcreteExampleTable`` class like so:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explanation what "auto-tables" are should probably be first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aka -> a.k.a., makes it more clear for non-English native speakers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.?
en/development/configuration.rst
Outdated
| // Disable Auto-Tables | ||
| EventManager::instance()->on('Model.initialize', function($event) { | ||
| if (get_class($event->getSubject()) === 'Cake\ORM\Table') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$subject = ($event->getSubject();is used twice.
Good to merge? |
|
Note: https://github.com/AD7six/cakephp-shadow-translate fires off generic tables by default and does not work if they are disabled until you bake the minimum tables. |
Ref: cakephp/cakephp#10302