Skip to content

Commit

Permalink
Add docs for cakephp/cakephp#18136
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 23, 2025
1 parent 25c978b commit 8275518
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions en/appendices/5-2-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ ORM
- ``CounterCacheBehavior::updateCounterCache()`` has been addded. This method
allows you to update the counter cache values for all records of the configured
associations.
- ``BelongsToMany::setJunctionProperty()`` and ``getJunctionProperty()`` were
added. These methods allow you to customize the ``_joinData`` property that is
used to hydrate junction table records.


View
----
Expand Down
13 changes: 12 additions & 1 deletion en/orm/saving-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,18 @@ from request data your POST data should look like::
]);

See the :ref:`associated-form-inputs` documentation for how to build inputs with
``FormHelper`` correctly.
``FormHelper`` correctly. As of 5.2.0, the ``_joinData`` property can be renamed
with ``setJunctionProperty()``::

// in StudentsTable::initialize()
$this->belongsToMany('Courses')
->setJunctionProperty('course_mark');

When a junction property is set, the new junction property name must be used to
manipulate entities, marshall request data, and create form fields.

.. versionadded:: 5.2.0
Custom junction property names were added.

.. _saving-complex-types:

Expand Down

0 comments on commit 8275518

Please sign in to comment.