Skip to content

Commit

Permalink
fix2: Resolve review comments related to HasRootProblem behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Oct 1, 2024
1 parent d8a6fed commit d824e9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 6 additions & 6 deletions application/controllers/ServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public function init()
$query = Service::on($this->getDb())
->withColumns(['has_root_problem'])
->with([
'state',
'icon_image',
'host',
'host.state',
'timeperiod'
]);
'state',
'icon_image',
'host',
'host.state',
'timeperiod'
]);
$query
->setResultSetClass(VolatileStateResults::class)
->filter(Filter::all(
Expand Down
7 changes: 5 additions & 2 deletions library/Icingadb/Model/Behavior/HasRootProblem.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
use ipl\Orm\Contract\RewriteColumnBehavior;
use ipl\Orm\Contract\QueryAwareBehavior;

/**
* Behavior to check if the object has a root problem
*/
class HasRootProblem implements RewriteColumnBehavior, QueryAwareBehavior
{
/** @var Query */
protected $query;

public function setQuery(Query $query)
public function setQuery(Query $query): self
{
$this->query = $query;

Expand Down Expand Up @@ -64,7 +67,7 @@ public function rewriteColumnDefinition(ColumnDefinition $def, string $relation)
{
}

public function rewriteCondition(Filter\Condition $condition, $relation = null)
public function rewriteCondition(Filter\Condition $condition, $relation = null): void
{
$column = substr($condition->getColumn(), strlen($relation));

Expand Down

0 comments on commit d824e9a

Please sign in to comment.