object = $object; return $this; } /** * Get this action's object * * @return Host|Service */ protected function getObject() { return $this->object; } /** * Set the filter to use when being asked whether to render this action * * @param string $filter * * @return $this */ public function setFilter(string $filter): self { $this->filter = $filter; return $this; } /** * Get the filter to use when being asked whether to render this action * * @return ?string */ public function getFilter(): ?string { return $this->filter; } /** * Set this item's url * * @param \Icinga\Web\Url|string $url * * @return $this */ public function setUrl($url): self { if (is_string($url)) { $this->rawUrl = $url; } else { parent::setUrl($url); } return $this; } public function getUrl(): ?\Icinga\Web\Url { $url = parent::getUrl(); if (! $this->resolved && $url === null && $this->rawUrl !== null && $this->object !== null) { $this->setUrl(Url::fromPath($this->expandMacros($this->rawUrl, $this->getObject()))); $this->resolved = true; return parent::getUrl(); } else { return $url; } } public function getRender(): bool { if ($this->render === null) { $filter = $this->getFilter(); $this->render = ! $filter || $this->isMatchedOn($filter, $this->getObject()); } return $this->render; } }