Skip to content

Commit 65788ae

Browse files
committed
docs(database): clarify whereColumn operator behavior
- Explain supported terminal operator detection - Document equality fallback for other operators - Update API reference parameter wording Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent 287432c commit 65788ae

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

user_guide_src/source/database/query_builder.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,16 @@ $builder->whereColumn()
372372

373373
.. versionadded:: 4.8.0
374374

375-
Compares one column to another column. If no operator is provided, ``=`` is
376-
used:
375+
Compares one column to another column. If the first parameter does not end with
376+
a supported operator, ``=`` is used:
377377

378378
.. literalinclude:: query_builder/123.php
379379

380-
You can include an operator in the first parameter in order to control the
381-
comparison. Supported operators are ``=``, ``!=``, ``<>``, ``<``, ``>``, ``<=``,
382-
and ``>=``. If none of these operators is detected at the end of the first
383-
parameter, ``=`` is used. Empty column names throw an ``InvalidArgumentException``.
380+
You can include a supported operator at the end of the first parameter in order
381+
to control the comparison. Supported operators are ``=``, ``!=``, ``<>``, ``<``,
382+
``>``, ``<=``, and ``>=``. If none of these operators is detected at the end of the first
383+
parameter, ``=`` is used. Empty
384+
column names throw an ``InvalidArgumentException``.
384385

385386
Column names are protected by default, unless the ``$escape`` parameter is
386387
``false``.
@@ -1565,7 +1566,7 @@ Class Reference
15651566

15661567
.. php:method:: whereColumn($first, $second[, $escape = null])
15671568
1568-
:param string $first: First column name, optionally with comparison operator
1569+
:param string $first: First column name, optionally ending with a supported comparison operator
15691570
:param string $second: Second column name
15701571
:param bool $escape: Whether to protect identifiers
15711572
:returns: ``BaseBuilder`` instance (method chaining)
@@ -1577,7 +1578,7 @@ Class Reference
15771578

15781579
.. php:method:: orWhereColumn($first, $second[, $escape = null])
15791580
1580-
:param string $first: First column name, optionally with comparison operator
1581+
:param string $first: First column name, optionally ending with a supported comparison operator
15811582
:param string $second: Second column name
15821583
:param bool $escape: Whether to protect identifiers
15831584
:returns: ``BaseBuilder`` instance (method chaining)

0 commit comments

Comments
 (0)