Skip to content

Commit 71127d5

Browse files
committed
🚑 Builder fix
1 parent c737011 commit 71127d5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Builder.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ public function where(
307307
$this->whereNotLike($key, $value, true, $boolean);
308308
} elseif ($operator === 'not ilike') {
309309
$this->whereNotLike($key, $value, false, $boolean);
310+
} else {
311+
$where->push(($where->count() ? $boolean . ' ' : '') . $key . ' ' . $operator . ' ' . $value);
312+
$this->query->put('where', $where);
310313
}
311314
} else {
312315
$value = !is_int($value) ? json_encode($value) : $value;
@@ -1049,7 +1052,7 @@ public function orWhereNotNull(string $key, string $boolean = '|'): self
10491052
*
10501053
* @return self
10511054
*/
1052-
public function whereDate(string $key, $operator, $value, string $boolean = '&'): self
1055+
public function whereDate(string $key, $operator, $value = null, string $boolean = '&'): self
10531056
{
10541057
[$value, $operator] = $this->prepareValueAndOperator($value, $operator,
10551058
func_num_args() === 2);
@@ -1113,7 +1116,7 @@ public function orWhereDate(string $key, $operator, $value, string $boolean = '|
11131116
*
11141117
* @return self
11151118
*/
1116-
public function whereYear(string $key, $operator, $value, string $boolean = '&'): self
1119+
public function whereYear(string $key, $operator, $value = null, string $boolean = '&'): self
11171120
{
11181121
[$value, $operator] = $this->prepareValueAndOperator($value, $operator,
11191122
func_num_args() === 2);
@@ -1311,7 +1314,7 @@ public function cache($seconds): self
13111314
*
13121315
* @return string
13131316
*/
1314-
protected function getQuery(): string
1317+
public function getQuery(): string
13151318
{
13161319
return $this->query->map(function ($value, $key) {
13171320
if ($key === 'where') {
@@ -1443,7 +1446,7 @@ function () use ($endpoint) {
14431446
});
14441447
}
14451448

1446-
$this->initClient();
1449+
$this->init();
14471450

14481451
return $data;
14491452
}
@@ -1560,7 +1563,7 @@ function () use ($accessToken, $endpoint) {
15601563
->json();
15611564
});
15621565

1563-
$this->initClient();
1566+
$this->init();
15641567

15651568
return $data;
15661569
}

0 commit comments

Comments
 (0)