Skip to content

Commit 129fae7

Browse files
committed
refactor(database): address whereExists review feedbacks
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent 4ca9a14 commit 129fae7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

system/Database/BaseBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ public function orWhereColumn(string $first, string $second, ?bool $escape = nul
778778
*/
779779
public function whereExists($subquery): static
780780
{
781-
return $this->_whereExists($subquery);
781+
return $this->whereExistsSubquery($subquery);
782782
}
783783

784784
/**
@@ -790,7 +790,7 @@ public function whereExists($subquery): static
790790
*/
791791
public function orWhereExists($subquery): static
792792
{
793-
return $this->_whereExists($subquery, false, 'OR ');
793+
return $this->whereExistsSubquery($subquery, false, 'OR ');
794794
}
795795

796796
/**
@@ -802,7 +802,7 @@ public function orWhereExists($subquery): static
802802
*/
803803
public function whereNotExists($subquery): static
804804
{
805-
return $this->_whereExists($subquery, true);
805+
return $this->whereExistsSubquery($subquery, true);
806806
}
807807

808808
/**
@@ -814,7 +814,7 @@ public function whereNotExists($subquery): static
814814
*/
815815
public function orWhereNotExists($subquery): static
816816
{
817-
return $this->_whereExists($subquery, true, 'OR ');
817+
return $this->whereExistsSubquery($subquery, true, 'OR ');
818818
}
819819

820820
/**
@@ -888,7 +888,7 @@ private function parseWhereColumnFirst(string $first): array
888888
*
889889
* @throws InvalidArgumentException
890890
*/
891-
protected function _whereExists($subquery, bool $not = false, string $type = 'AND '): static
891+
protected function whereExistsSubquery($subquery, bool $not = false, string $type = 'AND '): static
892892
{
893893
if (! $this->isSubquery($subquery)) {
894894
throw new InvalidArgumentException(sprintf('%s() expects $subquery to be of type BaseBuilder or closure', debug_backtrace(0, 2)[1]['function']));

user_guide_src/source/database/query_builder.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ a ``BaseBuilder`` instance:
409409

410410
.. warning:: Raw SQL strings are not accepted. If you need to write the
411411
``EXISTS`` clause yourself, use ``where()`` with a manually escaped
412-
condition.
412+
condition. See :ref:`query-builder-where-rawsql`.
413413

414414
$builder->orWhereExists()
415415
-------------------------

0 commit comments

Comments
 (0)