1
|
<?php
|
2
|
|
3
|
|
4
|
namespace App\Model;
|
5
|
|
6
|
|
7
|
use Nette\Http\Session;
|
8
|
use Nette\Http\SessionSection;
|
9
|
|
10
|
class TransportModel
|
11
|
{
|
12
|
const SECTION_NAME = "Transport";
|
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 getTransportSection(){
|
28
|
return $this->section;
|
29
|
}
|
30
|
|
31
|
/**
|
32
|
* @param array $parsedText
|
33
|
*/
|
34
|
public function setParsedText(array $parsedText){
|
35
|
$this->section->parsedText = $parsedText;
|
36
|
}
|
37
|
|
38
|
/**
|
39
|
* @return array
|
40
|
*/
|
41
|
public function getParsedText(){
|
42
|
return $this->section->parsedText;
|
43
|
}
|
44
|
}
|