Skip to content

Commit

Permalink
Update counter-cache.rst (#7927)
Browse files Browse the repository at this point in the history
Update counter-cache.rst

Refs cakephp/cakephp#17966
  • Loading branch information
ADmad authored Oct 14, 2024
1 parent 7dd2386 commit c895f0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions en/orm/behaviors/counter-cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ then updates the counter of the *previously* associated item.
behavior to the ``CommentsTable`` in order to generate ``comment_count`` for
Articles table.

.. versionchanged:: 5.1.2

As of CakePHP 5.1.2, the counter cache values are updated using a single
query using sub-queries, instead of separate queries, to fetch the count and
update a record. If required you can disable the use of sub-queries by
setting `useSubQuery` key to `false` in the config
`['Articles' => ['comment_count' => ['useSubQuery' => false]]`

Belongs to many Usage
=====================

Expand Down

0 comments on commit c895f0f

Please sign in to comment.