1
|
<?php
|
2
|
|
3
|
namespace App\Model;
|
4
|
|
5
|
|
6
|
use Nette\Http\Session;
|
7
|
use Nette\Http\SessionSection;
|
8
|
use Nette\Utils\ArrayHash;
|
9
|
|
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
|
public function setSearchTerms(ArrayHash $searchTerms)
|
33
|
{
|
34
|
$this->section->searchTerms = $searchTerms;
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
* @return null|ArrayHash
|
39
|
*/
|
40
|
public function getSearchTerms()
|
41
|
{
|
42
|
return $this->section->searchTerms;
|
43
|
}
|
44
|
}
|