From 17ebe07e578713ee0c61af9f628ca3f2a9986205 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 11 May 2015 15:37:00 +0200 Subject: [PATCH] Implement Icinga\Web\Widget\SortBox::setQuery() refs #9220 --- library/Icinga/Web/Widget/SortBox.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index 80c413658..1026596ca 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -5,6 +5,7 @@ namespace Icinga\Web\Widget; use Icinga\Web\Form; use Icinga\Web\Request; +use Icinga\Data\Sortable; /** * SortBox widget @@ -49,6 +50,13 @@ class SortBox extends AbstractWidget */ protected $request; + /** + * What to apply sort parameters on + * + * @var Sortable + */ + protected $query = null; + /** * Create a SortBox with the entries from $sortFields * @@ -87,6 +95,17 @@ class SortBox extends AbstractWidget return $this; } + /** + * @param Sortable $query + * + * @return $this + */ + public function setQuery(Sortable $query) + { + $this->query = $query; + return $this; + } + /** * Render this SortBox as HTML *