Implement Icinga\Web\Widget\SortBox::setQuery()

refs #9220
This commit is contained in:
Alexander A. Klimov 2015-05-11 15:37:00 +02:00
parent 295254d1d5
commit 17ebe07e57

View File

@ -5,6 +5,7 @@ namespace Icinga\Web\Widget;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Request; use Icinga\Web\Request;
use Icinga\Data\Sortable;
/** /**
* SortBox widget * SortBox widget
@ -49,6 +50,13 @@ class SortBox extends AbstractWidget
*/ */
protected $request; protected $request;
/**
* What to apply sort parameters on
*
* @var Sortable
*/
protected $query = null;
/** /**
* Create a SortBox with the entries from $sortFields * Create a SortBox with the entries from $sortFields
* *
@ -87,6 +95,17 @@ class SortBox extends AbstractWidget
return $this; return $this;
} }
/**
* @param Sortable $query
*
* @return $this
*/
public function setQuery(Sortable $query)
{
$this->query = $query;
return $this;
}
/** /**
* Render this SortBox as HTML * Render this SortBox as HTML
* *