Skip to content

Commit

Permalink
Document changes in cakephp/cakephp#17882
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 8, 2024
1 parent 4372b03 commit 6d90f3c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions en/appendices/5-1-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Behavior Changes
- The default value for ``valueSeparator`` in ``Table::findList()`` is now
a single space instead of ``;``.
- ``ErrorLogger`` uses ``Psr\Log\LogTrait`` now.
- ``Database\QueryCompiler::$_orderedUnion`` was removed.

Deprecations
============
Expand Down Expand Up @@ -100,6 +101,11 @@ Database
functions to manipulate data as geospatial values.
- ``SelectQuery::__debugInfo()`` now includes which connection role the query
is for.
- ``SelectQuery::intersect()`` and ``SelectQuery::intersectAll()`` were added.
These methods enable queries using ``INTERSECT`` and ``INTERSECT ALL``
conjunctions to be expressed.
- New supports features were added for ``intersect``, ``intersect-all`` and
``set-operations-order-by`` features.

Datasource
----------
Expand Down
28 changes: 28 additions & 0 deletions en/orm/query-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,34 @@ You can create ``UNION ALL`` queries using the ``unionAll()`` method::

$unpublished->unionAll($inReview);

Intersections
-------------

Intersections allow you to combine the result sets of two queries together and
finding results with overlapping results. Intersections are created by composing
one or more select queries together::

$inReview = $articles->find()
->where(['need_review' => true]);

$unpublished = $articles->find()
->where(['published' => false]);

$unpublished->intersect($inReview);

You can create ``INTERSECT ALL`` queries using the ``intersectAll()`` method::

$inReview = $articles->find()
->where(['need_review' => true]);

$unpublished = $articles->find()
->where(['published' => false]);

$unpublished->intersectAll($inReview);

.. versionadded:: 5.1.0
``intersect()`` and ``intersectAll()`` were added.

Subqueries
----------

Expand Down

0 comments on commit 6d90f3c

Please sign in to comment.