Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions en/orm/saving-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ passing it to the ``save()`` method in the ``Table`` class::
// The $article entity contains the id now
$id = $article->id;
}

If your model (eg. ArticlesTable.php) is in a plugin you may find that TableRegistry::get() still works but that your validation rules or other callbacks in ArticlesTable.php may not be triggering. This is because TableRegistry::get() builds a default model for the table. Here are some examples for TableRegistry::get() that you may want to use when your class is in a plugin::

Plugin example (same as above except)::

$articlesTable = TableRegistry::get('PluginName.Articles');

Composer installed plugin example (same as above except)::
Copy link
Member

Choose a reason for hiding this comment

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

I think the term is vendor name prefixed plugin.


$articlesTable = TableRegistry::get('VendorName/PluginName.Articles');


Updating Data
-------------
Expand Down