Skip to content

Conversation

@inoas
Copy link
Contributor

@inoas inoas commented Mar 2, 2017

@inoas inoas changed the title How to disable auto-tables 3.x How to disable auto-tables Mar 2, 2017
@markstory markstory added this to the 3.x milestone Mar 2, 2017
@markstory markstory self-assigned this Mar 2, 2017
@inoas
Copy link
Contributor Author

inoas commented Mar 3, 2017

Anything to change?

Disabling Auto-Tables
=====================

While auto-tables are really useful when quickly creating new applications and baking models, they can be hard to debug.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard -> difficult

Copy link
Member

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.


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.
Copy link
Member

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

Copy link
Member

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"?

Copy link
Contributor Author

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 ?

Copy link
Contributor Author

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.


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::
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g.?

// Disable Auto-Tables
EventManager::instance()->on('Model.initialize', function($event) {
if (get_class($event->getSubject()) === 'Cake\ORM\Table') {
Copy link
Member

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.

@inoas
Copy link
Contributor Author

inoas commented Mar 4, 2017

  • aka -> e.g.
  • attribute off not genitive of
  • $subject var
  • wording
  • formatting
  • meta keywords

Good to merge?

@markstory markstory merged commit 928a62e into cakephp:3.0 Mar 5, 2017
markstory added a commit that referenced this pull request Mar 5, 2017
okinaka added a commit to okinaka/docs that referenced this pull request Mar 5, 2017
@inoas
Copy link
Contributor Author

inoas commented Mar 5, 2017

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.

okinaka added a commit to okinaka/docs that referenced this pull request Mar 5, 2017
okinaka added a commit to okinaka/docs that referenced this pull request Mar 5, 2017
HavokInspiration added a commit that referenced this pull request Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants