-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPage.php
50 lines (43 loc) · 1001 Bytes
/
Page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Definition of class Page
*
* @copyright 2014-today Justso GmbH
* @author [email protected]
* @package justso\justtexts\model
*/
namespace justso\justtexts;
use justso\justapi\RequestHelper;
/**
* Class Page
* @package justso\justtexts\model
*/
class Page implements PageInterface
{
protected $name;
public function __construct($id = null, $value = null, RequestHelper $request = null)
{
if ($request !== null) {
$this->name = $request->getIdentifierParam('name');
} else {
$this->name = $value;
}
}
public function getJSON()
{
return array('id' => $this->name, 'name' => $this->name);
}
public function getId()
{
return $this->name;
}
/**
* Appends the current page configuration to the page config array.
*
* @param array $config
*/
public function appendConfig(array &$config)
{
$config[] = $this->name;
}
}