Skip to content

Commit 6d90f3c

Browse files
committed
Document changes in cakephp/cakephp#17882
1 parent 4372b03 commit 6d90f3c

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

en/appendices/5-1-migration-guide.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Behavior Changes
3636
- The default value for ``valueSeparator`` in ``Table::findList()`` is now
3737
a single space instead of ``;``.
3838
- ``ErrorLogger`` uses ``Psr\Log\LogTrait`` now.
39+
- ``Database\QueryCompiler::$_orderedUnion`` was removed.
3940

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

104110
Datasource
105111
----------

en/orm/query-builder.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,34 @@ You can create ``UNION ALL`` queries using the ``unionAll()`` method::
17061706

17071707
$unpublished->unionAll($inReview);
17081708

1709+
Intersections
1710+
-------------
1711+
1712+
Intersections allow you to combine the result sets of two queries together and
1713+
finding results with overlapping results. Intersections are created by composing
1714+
one or more select queries together::
1715+
1716+
$inReview = $articles->find()
1717+
->where(['need_review' => true]);
1718+
1719+
$unpublished = $articles->find()
1720+
->where(['published' => false]);
1721+
1722+
$unpublished->intersect($inReview);
1723+
1724+
You can create ``INTERSECT ALL`` queries using the ``intersectAll()`` method::
1725+
1726+
$inReview = $articles->find()
1727+
->where(['need_review' => true]);
1728+
1729+
$unpublished = $articles->find()
1730+
->where(['published' => false]);
1731+
1732+
$unpublished->intersectAll($inReview);
1733+
1734+
.. versionadded:: 5.1.0
1735+
``intersect()`` and ``intersectAll()`` were added.
1736+
17091737
Subqueries
17101738
----------
17111739

0 commit comments

Comments
 (0)