1 |
3416b114
|
Jan Šedivý
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace App\Model;
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
use Nette\Http\Session;
|
7 |
|
|
use Nette\Http\SessionSection;
|
8 |
395eced7
|
Jan Šedivý
|
use Nette\Utils\ArrayHash;
|
9 |
3416b114
|
Jan Šedivý
|
|
10 |
|
|
class TransliterationSearchModel
|
11 |
|
|
{
|
12 |
|
|
const SECTION_NAME = 'TransliterationSearch';
|
13 |
|
|
const SECTION_EXPIRATION = 0;
|
14 |
|
|
|
15 |
|
|
/** @var SessionSection */
|
16 |
|
|
private $section;
|
17 |
|
|
|
18 |
|
|
public function __construct(Session $session)
|
19 |
|
|
{
|
20 |
|
|
$this->section = $session->getSection(self::SECTION_NAME);
|
21 |
|
|
$this->section->setExpiration(self::SECTION_EXPIRATION);
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
/**
|
25 |
|
|
* @return SessionSection
|
26 |
|
|
*/
|
27 |
|
|
public function getTransliterationSearchSection()
|
28 |
|
|
{
|
29 |
|
|
return $this->section;
|
30 |
|
|
}
|
31 |
|
|
|
32 |
395eced7
|
Jan Šedivý
|
public function setSearchTerms(ArrayHash $searchTerms)
|
33 |
3416b114
|
Jan Šedivý
|
{
|
34 |
|
|
$this->section->searchTerms = $searchTerms;
|
35 |
|
|
}
|
36 |
|
|
|
37 |
395eced7
|
Jan Šedivý
|
/**
|
38 |
|
|
* @return null|ArrayHash
|
39 |
|
|
*/
|
40 |
3416b114
|
Jan Šedivý
|
public function getSearchTerms()
|
41 |
|
|
{
|
42 |
|
|
return $this->section->searchTerms;
|
43 |
|
|
}
|
44 |
|
|
}
|