You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
667 B
PHP
25 lines
667 B
PHP
<?php
|
|
|
|
namespace Controllers\Categories;
|
|
|
|
use BusinessLogic\Categories\CategoryRetriever;
|
|
|
|
class CategoryController {
|
|
function get($id) {
|
|
$categories = self::getAllCategories();
|
|
output($categories[$id]);
|
|
}
|
|
|
|
static function printAllCategories() {
|
|
output(self::getAllCategories());
|
|
}
|
|
|
|
private static function getAllCategories() {
|
|
global $hesk_settings, $applicationContext, $userContext;
|
|
|
|
/* @var $categoryRetriever CategoryRetriever */
|
|
$categoryRetriever = $applicationContext->get[CategoryRetriever::class];
|
|
|
|
return $categoryRetriever->getAllCategories($hesk_settings, $userContext);
|
|
}
|
|
} |