From 0d27883c27ecac4951922b66d5b50908fad65aed Mon Sep 17 00:00:00 2001 From: raviks789 Date: Mon, 14 Oct 2024 16:37:48 +0200 Subject: [PATCH] Change name `HasRootProblem` to `HasProblematicParent` --- application/controllers/ServiceController.php | 2 +- .../{HasRootProblem.php => HasProblematicParent.php} | 6 +++--- library/Icingadb/Model/Service.php | 4 ++-- library/Icingadb/Widget/Detail/ObjectDetail.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename library/Icingadb/Model/Behavior/{HasRootProblem.php => HasProblematicParent.php} (94%) diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 90b3a4412..2857718ae 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -39,7 +39,7 @@ public function init() $hostName = $this->params->getRequired('host.name'); $query = Service::on($this->getDb()) - ->withColumns(['has_root_problem']) + ->withColumns(['has_problematic_parent']) ->with([ 'state', 'icon_image', diff --git a/library/Icingadb/Model/Behavior/HasRootProblem.php b/library/Icingadb/Model/Behavior/HasProblematicParent.php similarity index 94% rename from library/Icingadb/Model/Behavior/HasRootProblem.php rename to library/Icingadb/Model/Behavior/HasProblematicParent.php index bb5a0e111..d5a566cdc 100644 --- a/library/Icingadb/Model/Behavior/HasRootProblem.php +++ b/library/Icingadb/Model/Behavior/HasProblematicParent.php @@ -16,9 +16,9 @@ use ipl\Orm\Contract\QueryAwareBehavior; /** - * Behavior to check if the object has a root problem + * Behavior to check if the service has a problematic parent */ -class HasRootProblem implements RewriteColumnBehavior, QueryAwareBehavior +class HasProblematicParent implements RewriteColumnBehavior, QueryAwareBehavior { use Database; @@ -79,7 +79,7 @@ public function rewriteColumn($column, ?string $relation = null): ?AliasedExpres public function isSelectableColumn(string $name): bool { - return $name === 'has_root_problem'; + return $name === 'has_problematic_parent'; } public function rewriteColumnDefinition(ColumnDefinition $def, string $relation): void diff --git a/library/Icingadb/Model/Service.php b/library/Icingadb/Model/Service.php index d34fd14a2..d895789ec 100644 --- a/library/Icingadb/Model/Service.php +++ b/library/Icingadb/Model/Service.php @@ -6,7 +6,7 @@ use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Model\Behavior\BoolCast; -use Icinga\Module\Icingadb\Model\Behavior\HasRootProblem; +use Icinga\Module\Icingadb\Model\Behavior\HasProblematicParent; use Icinga\Module\Icingadb\Model\Behavior\ReRoute; use ipl\Orm\Behavior\Binary; use ipl\Orm\Behaviors; @@ -196,7 +196,7 @@ public function createBehaviors(Behaviors $behaviors) 'command_endpoint_id' ])); - $behaviors->add(new HasRootProblem()); + $behaviors->add(new HasProblematicParent()); } public function createDefaults(Defaults $defaults) diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php index a74c79533..9a95f297d 100644 --- a/library/Icingadb/Widget/Detail/ObjectDetail.php +++ b/library/Icingadb/Widget/Detail/ObjectDetail.php @@ -612,7 +612,7 @@ protected function createRootProblems(): ?array // host being down, only show its root problems if they exist. if ( $this->object->state->is_reachable - || ($this->object instanceof Service && ! $this->object->has_root_problem) + || ($this->object instanceof Service && ! $this->object->has_problematic_parent) ) { return null; }