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

36 lines
1.2 KiB
PHP
Raw Normal View History

<?php
// Responsible for loading in all necessary classes. AKA a poor man's DI solution.
2017-02-01 22:04:52 -05:00
use BusinessLogic\Categories\CategoryRetriever;
2017-01-28 01:41:29 -05:00
use BusinessLogic\Security\BanRetriever;
use BusinessLogic\Security\UserContextBuilder;
2017-01-31 22:26:46 -05:00
use BusinessLogic\Tickets\TicketRetriever;
2017-02-01 22:04:52 -05:00
use DataAccess\Categories\CategoryGateway;
2017-01-28 01:41:29 -05:00
use DataAccess\Security\BanGateway;
use DataAccess\Security\UserGateway;
2017-01-31 22:26:46 -05:00
use DataAccess\Tickets\TicketGateway;
2017-02-01 22:04:52 -05:00
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
2017-01-31 22:26:46 -05:00
// Tickets
$this->get['TicketGateway'] = new TicketGateway();
$this->get['TicketRetriever'] = new TicketRetriever($this->get['TicketGateway']);
// 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']);
}
}