Mods-for-HESK-Netsyms/api/ApplicationContext.php

31 lines
965 B
PHP
Raw Normal View History

<?php
namespace Core;
// Responsible for loading in all necessary classes. AKA a poor man's DI solution.
use BusinessLogic\Category\CategoryRetriever;
2017-01-28 01:41:29 -05:00
use BusinessLogic\Security\BanRetriever;
use BusinessLogic\Security\UserContextBuilder;
use DataAccess\CategoryGateway;
2017-01-28 01:41:29 -05:00
use DataAccess\Security\BanGateway;
use DataAccess\Security\UserGateway;
2017-01-28 01:41:29 -05:00
class ApplicationContext {
public $get;
function __construct() {
$this->get = array();
// Categories
$this->get['CategoryGateway'] = new CategoryGateway();
$this->get['CategoryRetriever'] = new CategoryRetriever($this->get['CategoryGateway']);
2017-01-28 01:41:29 -05:00
// Bans
2017-01-28 01:41:29 -05:00
$this->get['BanGateway'] = new BanGateway();
$this->get['BanRetriever'] = new BanRetriever($this->get['BanGateway']);
// User Context
$this->get['UserGateway'] = new UserGateway();
$this->get['UserContextBuilder'] = new UserContextBuilder($this->get['UserGateway']);
}
}