Add a status controller to retrieve statuses
parent
167d6c76ac
commit
fd41a589fe
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace BusinessLogic\Statuses;
|
||||
|
||||
|
||||
use DataAccess\Statuses\StatusGateway;
|
||||
|
||||
// TODO Test!
|
||||
class StatusRetriever {
|
||||
/* @var $statusGateway StatusGateway */
|
||||
private $statusGateway;
|
||||
|
||||
function __construct($statusGateway) {
|
||||
$this->statusGateway = $statusGateway;
|
||||
}
|
||||
|
||||
function getAllStatuses($heskSettings) {
|
||||
return $this->statusGateway->getStatuses($heskSettings);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Controllers\Statuses;
|
||||
|
||||
|
||||
use BusinessLogic\Statuses\StatusRetriever;
|
||||
|
||||
class StatusController {
|
||||
function get() {
|
||||
global $applicationContext, $hesk_settings;
|
||||
|
||||
/* @var $statusRetriever StatusRetriever */
|
||||
$statusRetriever = $applicationContext->get[StatusRetriever::class];
|
||||
|
||||
output($statusRetriever->getAllStatuses($hesk_settings));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue