1 | <?php |
||
23 | class ApplicationStorage extends AbstractStorage |
||
24 | { |
||
25 | /** @var string */ |
||
26 | protected $dataGroup = 'webhemi_application'; |
||
27 | /** @var string */ |
||
28 | protected $idKey = 'id_application'; |
||
29 | /** @var string */ |
||
30 | private $name = 'name'; |
||
31 | /** @var string */ |
||
32 | private $title = 'title'; |
||
33 | /** @var string */ |
||
34 | private $description = 'description'; |
||
35 | /** @var string */ |
||
36 | private $isReadOnly = 'is_read_only'; |
||
37 | /** @var string */ |
||
38 | private $isEnabled = 'is_enabled'; |
||
39 | /** @var string */ |
||
40 | private $dateCreated = 'date_created'; |
||
41 | /** @var string */ |
||
42 | private $dateModified = 'date_modified'; |
||
43 | |||
44 | /** |
||
45 | * Populates an entity with storage data. |
||
46 | * |
||
47 | * @param EntityInterface $dataEntity |
||
48 | * @param array $data |
||
49 | * @return void |
||
50 | */ |
||
51 | 3 | protected function populateEntity(EntityInterface&$dataEntity, array $data) : void |
|
63 | |||
64 | /** |
||
65 | * Get data from an entity. |
||
66 | * |
||
67 | * @param EntityInterface $dataEntity |
||
68 | * @return array |
||
69 | */ |
||
70 | 3 | protected function getEntityData(EntityInterface $dataEntity) : array |
|
87 | |||
88 | /** |
||
89 | * Returns every Application entity. |
||
90 | * |
||
91 | * @return array|ApplicationEntity[] |
||
92 | */ |
||
93 | 1 | public function getApplications() |
|
94 | { |
||
95 | /** @var ApplicationEntity[] $entityList */ |
||
96 | 1 | $entityList = $this->getDataEntitySet([]); |
|
97 | |||
98 | 1 | return $entityList; |
|
99 | } |
||
100 | |||
101 | /** |
||
102 | * Returns a Application entity identified by (unique) ID. |
||
103 | * |
||
104 | * @param int $identifier |
||
105 | * @return null|ApplicationEntity |
||
106 | */ |
||
107 | 1 | public function getApplicationById($identifier) : ? ApplicationEntity |
|
114 | |||
115 | /** |
||
116 | * Returns an Application entity by name. |
||
117 | * |
||
118 | * @param string $name |
||
119 | * @return null|ApplicationEntity |
||
120 | */ |
||
121 | 1 | public function getApplicationByName($name) : ? ApplicationEntity |
|
128 | } |
||
129 |