| @@ 102-121 (lines=20) @@ | ||
| 99 | * @param array $data The Data. |
|
| 100 | * @throws Exception When $data index is not set. |
|
| 101 | */ |
|
| 102 | public function __construct(array $data) |
|
| 103 | { |
|
| 104 | parent::__construct($data); |
|
| 105 | ||
| 106 | if (!isset($data['event/loader'])) { |
|
| 107 | throw new Exception('Event Loader must be defined in the EventManager constructor.'); |
|
| 108 | } |
|
| 109 | ||
| 110 | $this->setLoader($data['event/loader']); |
|
| 111 | ||
| 112 | /** @var CmsConfig $eventConfig */ |
|
| 113 | $eventConfig = $this->adminConfig()->eventConfig(); |
|
| 114 | ||
| 115 | // City.json |
|
| 116 | $this->setNumPerPage($eventConfig->get('numPerPage')); |
|
| 117 | $this->setEntryCycle($eventConfig->get('entryCycle')); |
|
| 118 | $this->setObjType($eventConfig->get('objType')); |
|
| 119 | $this->setCategoryItemType($eventConfig->get('category')); |
|
| 120 | $this->setFeatIdent($eventConfig->get('configFeatIdent')); |
|
| 121 | } |
|
| 122 | ||
| 123 | /** |
|
| 124 | * To be displayed events list. |
|
| @@ 88-106 (lines=19) @@ | ||
| 85 | * @param array $data The Data. |
|
| 86 | * @throws Exception When $data index is not set. |
|
| 87 | */ |
|
| 88 | public function __construct(array $data) |
|
| 89 | { |
|
| 90 | parent::__construct($data); |
|
| 91 | ||
| 92 | if (!isset($data['news/loader'])) { |
|
| 93 | throw new Exception('News Loader must be defined in the NewsManager constructor.'); |
|
| 94 | } |
|
| 95 | ||
| 96 | $this->setLoader($data['news/loader']); |
|
| 97 | ||
| 98 | /** @var CmsConfig $newsConfig */ |
|
| 99 | $newsConfig = $this->adminConfig()->newsConfig(); |
|
| 100 | ||
| 101 | $this->setNumPerPage($newsConfig->get('numPerPage')); |
|
| 102 | $this->setEntryCycle($newsConfig->get('entryCycle')); |
|
| 103 | $this->setObjType($newsConfig->get('objType')); |
|
| 104 | $this->setCategoryItemType($newsConfig->get('category')); |
|
| 105 | $this->setFeatIdent($newsConfig->get('configFeatIdent')); |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * To be displayed news list. |
|