[FOLLOWUP][BUGFIX] Add query restrictions for all tables in query
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Breaking-79615-QueryBuilderGetQueriedTablesResultFormatChange.rst
1 .. include:: ../../Includes.txt
2
3 =====================================================================
4 Breaking: #79615 - QueryBuilder getQueriedTables result format change
5 =====================================================================
6
7 See :issue:`79615`
8
9 Description
10 ===========
11
12 :php:`QueryBuilder::getQueriedTables` return value has been changed from array with key being table name and value being table alias (or null) to array with a key being table alias and value being table name. Both key and the value should be filled.
13 This allows to return multiple entries for the same table (in case inner join is made).
14
15 Example for the `tt_content` table inner joined with self and joined with `sys_language`:
16
17 .. code-block:: php
18
19 [
20 'tt_content_alias' => 'tt_content',
21 'tt_content' => 'tt_content',
22 'sys_language' => 'sys_language'
23 ]
24
25 Previously the array (for the same case) looked like:
26
27 .. code-block:: php
28
29 [
30 'tt_content' => 'tt_content_alias',
31 'sys_language' => null
32 ]
33
34
35 Impact
36 ======
37
38 All code which rely on the result format of the `getQueriedTables` method needs to be adapted.
39 The first parameter of the :php:`QueryRestrictionInterface::buildExpression` (:php:`$queriedTables`) expects a new array structure.
40
41
42 Affected Installations
43 ======================
44
45 All installations with custom implementation of Query Restriction (classes implementing :php:`QueryRestrictionInterface`).
46 All installations where table array passed to `buildExpression` method is created manually (without using :php:`QueryBuilder::getQueriedTables`).
47
48
49 Migration
50 =========
51
52 The code of the `buildExpression` method in custom :php:`QueryRestrictionInterface`
53 implementations needs to adapted to be able to handle the new incoming array structure.
54 Format of the first parameter passed to `buildExpression` needs to be adapted in case a query restriction is used directly (without using :php:`QueryBuilder::getQueriedTables`).
55
56 .. index:: PHP-API