Skip to content

Commit d562e7d

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

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
@@ -789,7 +789,7 @@ public function orWhereColumn(string $first, string $second, ?bool $escape = nul
789789
*/
790790
public function whereExists($subquery): static
791791
{
792-
return $this->_whereExists($subquery);
792+
return $this->whereExistsSubquery($subquery);
793793
}
794794

795795
/**
@@ -801,7 +801,7 @@ public function whereExists($subquery): static
801801
*/
802802
public function orWhereExists($subquery): static
803803
{
804-
return $this->_whereExists($subquery, false, 'OR ');
804+
return $this->whereExistsSubquery($subquery, false, 'OR ');
805805
}
806806

807807
/**
@@ -813,7 +813,7 @@ public function orWhereExists($subquery): static
813813
*/
814814
public function whereNotExists($subquery): static
815815
{
816-
return $this->_whereExists($subquery, true);
816+
return $this->whereExistsSubquery($subquery, true);
817817
}
818818

819819
/**
@@ -825,7 +825,7 @@ public function whereNotExists($subquery): static
825825
*/
826826
public function orWhereNotExists($subquery): static
827827
{
828-
return $this->_whereExists($subquery, true, 'OR ');
828+
return $this->whereExistsSubquery($subquery, true, 'OR ');
829829
}
830830

831831
/**
@@ -899,7 +899,7 @@ private function parseWhereColumnFirst(string $first): array
899899
*
900900
* @throws InvalidArgumentException
901901
*/
902-
protected function _whereExists($subquery, bool $not = false, string $type = 'AND '): static
902+
protected function whereExistsSubquery($subquery, bool $not = false, string $type = 'AND '): static
903903
{
904904
if (! $this->isSubquery($subquery)) {
905905
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)