Skip to content

Commit ab420a7

Browse files
committed
Fix
Signed-off-by: Andrey Pyzhikov <5071@mail.ru>
1 parent 2b4c7bb commit ab420a7

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

system/Database/BaseBuilder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ public function selectCount(string $select = '', string $alias = '')
453453
public function selectSubquery(BaseBuilder $subquery, string $as)
454454
{
455455
if (! $this->isSubquery($subquery)) {
456-
throw new DatabaseException('The BaseBuilder::selectSubquery method expects a BaseBuilder instance');
456+
throw new DatabaseException(
457+
'The BaseBuilder::selectSubquery() method expects a BaseBuilder instance.'
458+
);
457459
}
458460

459461
$this->QBSelect[] = $this->buildSubquery($subquery, true, $as);

user_guide_src/source/changelogs/v4.2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Enhancements
2424
- See :ref:`content-security-policy` for details.
2525
- New View Decorators allow modifying the generated HTML prior to caching.
2626
- Added Subqueries in the FROM section. See :ref:`query-builder-from-subquery`.
27-
- Added Subqueries in the SELECT section. See :ref:`query-builder-select-subquery`.
27+
- Added Subqueries in the SELECT section. See :ref:`query-builder-select`.
2828
- Added Validation Strict Rules. See :ref:`validation-traditional-and-strict-rules`.
2929
- Added new OCI8 driver for database.
3030
- It can access Oracle Database and supports SQL and PL/SQL statements.

user_guide_src/source/database/query_builder.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ method:
9898

9999
Please read about the ``where()`` method below for more information.
100100

101+
.. _query-builder-select:
102+
101103
Select
102104
======
103105

@@ -167,8 +169,6 @@ the resulting field.
167169
.. literalinclude:: query_builder/014.php
168170
:lines: 2-
169171

170-
.. _query-builder-select-subquery:
171-
172172
**$builder->selectSubquery()**
173173

174174
Adds a subquery to the SELECT section.

user_guide_src/source/database/query_builder/098.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
$builder = $db->table('users')->select('name')->selectSubquery($subquery, 'country');
55
$query = $builder->get();
66

7-
// Produces: SELECT `name`, (SELECT `name` FROM `countries` WHERE `id` = 1) AS `country` FROM `users`
7+
// Produces: SELECT `name`, (SELECT `name` FROM `countries` WHERE `id` = 1) AS `country` FROM `users`

0 commit comments

Comments
 (0)