Skip to content

Commit fbcc43a

Browse files
authored
Merge pull request #9072 from kenjis/docs-query_builder-join
docs: update QueryBuilder descriptions for join()
2 parents 9f76fed + 3d738fc commit fbcc43a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

user_guide_src/source/database/query_builder.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ Use the ``$db->newQuery()`` method to make a subquery the main table:
247247
Join
248248
====
249249

250+
.. _query-builder-join:
251+
250252
$builder->join()
251253
----------------
252254

@@ -270,7 +272,7 @@ RawSql
270272

271273
.. versionadded:: 4.2.0
272274

273-
Since v4.2.0, ``$builder->join()`` accepts a ``CodeIgniter\Database\RawSql`` instance, which expresses raw SQL strings.
275+
Since v4.2.0, ``$builder->join()`` accepts a ``CodeIgniter\Database\RawSql`` instance as the JOIN ON condition, which expresses raw SQL strings.
274276

275277
.. literalinclude:: query_builder/102.php
276278

@@ -1498,13 +1500,14 @@ Class Reference
14981500
.. php:method:: join($table, $cond[, $type = ''[, $escape = null]])
14991501
15001502
:param string $table: Table name to join
1501-
:param string $cond: The JOIN ON condition
1503+
:param string|RawSql $cond: The JOIN ON condition
15021504
:param string $type: The JOIN type
15031505
:param bool $escape: Whether to escape values and identifiers
15041506
:returns: ``BaseBuilder`` instance (method chaining)
15051507
:rtype: ``BaseBuilder``
15061508

1507-
Adds a ``JOIN`` clause to a query.
1509+
Adds a ``JOIN`` clause to a query. Since v4.2.0, ``RawSql`` can be used
1510+
as the JOIN ON condition. See also :ref:`query-builder-join`.
15081511

15091512
.. php:method:: where($key[, $value = null[, $escape = null]])
15101513

0 commit comments

Comments
 (0)