Skip to content

Commit

Permalink
Merge pull request #1 from dikopylov/getting-by-level
Browse files Browse the repository at this point in the history
Getting by level
  • Loading branch information
efureev authored Jul 29, 2020
2 parents 9d249bf + e4344c4 commit 3c7089b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,20 @@ public function toLevel(?int $level): self
return $this;
}

/**
* @param int|null $level
*
* @return $this
*/
public function byLevel(?int $level): self
{
if ($level !== null) {
$this->query->where($this->model->levelAttribute()->name(), $level);
}

return $this;
}

/**
* Get wrapped column names.
*
Expand Down

0 comments on commit 3c7089b

Please sign in to comment.