Skip to content

Commit

Permalink
Throw exceptions when querying status column
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed May 1, 2024
1 parent cce863e commit 26d9e18
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Entries/EntryQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,24 @@ public function with($relations, $callback = null)
return $this;
}

public function where($column, $operator = null, $value = null, $boolean = 'and')
{
if ($column === 'status') {
trigger_error('Filtering by status is deprecated. Use whereStatus() instead.', E_USER_DEPRECATED);
}

return parent::where($column, $operator, $value, $boolean);
}

public function whereIn($column, $values, $boolean = 'and')
{
if ($column === 'status') {
trigger_error('Filtering by status is deprecated. Use whereStatus() instead.', E_USER_DEPRECATED);
}

return parent::whereIn($column, $values, $boolean);
}

public function whereStatus(string $status)
{
if (! in_array($status, self::STATUSES)) {
Expand Down

0 comments on commit 26d9e18

Please sign in to comment.