2017-01-28 01:28:53 -05:00
|
|
|
<?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;
|
2017-01-28 22:35:42 -05:00
|
|
|
use BusinessLogic\Security\UserContextBuilder;
|
2017-02-13 22:34:15 -05:00
|
|
|
use BusinessLogic\Tickets\Autoassigner;
|
2017-01-31 22:26:46 -05:00
|
|
|
use BusinessLogic\Tickets\TicketRetriever;
|
2017-02-13 22:34:15 -05:00
|
|
|
use BusinessLogic\Tickets\TicketCreator;
|
|
|
|
use BusinessLogic\Tickets\NewTicketValidator;
|
|
|
|
use BusinessLogic\Tickets\TicketValidators;
|
|
|
|
use BusinessLogic\Tickets\TrackingIdGenerator;
|
2017-02-01 22:04:52 -05:00
|
|
|
use DataAccess\Categories\CategoryGateway;
|
2017-01-28 01:41:29 -05:00
|
|
|
use DataAccess\Security\BanGateway;
|
2017-01-28 22:35:42 -05:00
|
|
|
use DataAccess\Security\UserGateway;
|
2017-02-16 21:46:47 -05:00
|
|
|
use DataAccess\Statuses\StatusGateway;
|
2017-01-31 22:26:46 -05:00
|
|
|
use DataAccess\Tickets\TicketGateway;
|
2017-01-28 01:28:53 -05:00
|
|
|
|
2017-02-01 22:04:52 -05:00
|
|
|
|
2017-01-28 01:41:29 -05:00
|
|
|
class ApplicationContext {
|
2017-01-28 01:28:53 -05:00
|
|
|
public $get;
|
|
|
|
|
|
|
|
function __construct() {
|
|
|
|
$this->get = array();
|
|
|
|
|
2017-02-13 22:34:15 -05:00
|
|
|
// User Context
|
|
|
|
$this->get[UserGateway::class] = new UserGateway();
|
|
|
|
$this->get[UserContextBuilder::class] = new UserContextBuilder($this->get[UserGateway::class]);
|
2017-01-28 01:41:29 -05:00
|
|
|
|
2017-02-13 22:34:15 -05:00
|
|
|
// Categories
|
|
|
|
$this->get[CategoryGateway::class] = new CategoryGateway();
|
|
|
|
$this->get[CategoryRetriever::class] = new CategoryRetriever($this->get[CategoryGateway::class]);
|
2017-01-31 22:26:46 -05:00
|
|
|
|
2017-01-28 22:35:42 -05:00
|
|
|
// Bans
|
2017-02-13 22:34:15 -05:00
|
|
|
$this->get[BanGateway::class] = new BanGateway();
|
|
|
|
$this->get[BanRetriever::class] = new BanRetriever($this->get[BanGateway::class]);
|
2017-01-28 22:35:42 -05:00
|
|
|
|
2017-02-13 22:34:15 -05:00
|
|
|
// Tickets
|
2017-02-16 21:46:47 -05:00
|
|
|
$this->get[StatusGateway::class] = new StatusGateway();
|
2017-02-13 22:34:15 -05:00
|
|
|
$this->get[TicketGateway::class] = new TicketGateway();
|
|
|
|
$this->get[TicketRetriever::class] = new TicketRetriever($this->get[TicketGateway::class]);
|
|
|
|
$this->get[TicketValidators::class] = new TicketValidators($this->get[TicketGateway::class]);
|
|
|
|
$this->get[TrackingIdGenerator::class] = new TrackingIdGenerator($this->get[TicketGateway::class]);
|
|
|
|
$this->get[Autoassigner::class] = new Autoassigner();
|
|
|
|
$this->get[NewTicketValidator::class] = new NewTicketValidator($this->get[CategoryRetriever::class],
|
|
|
|
$this->get[BanRetriever::class],
|
|
|
|
$this->get[TicketValidators::class]);
|
|
|
|
$this->get[TicketCreator::class] = new TicketCreator($this->get[NewTicketValidator::class],
|
|
|
|
$this->get[TrackingIdGenerator::class],
|
|
|
|
$this->get[Autoassigner::class],
|
2017-02-16 21:46:47 -05:00
|
|
|
$this->get[StatusGateway::class],
|
2017-02-13 22:34:15 -05:00
|
|
|
$this->get[TicketGateway::class]);
|
2017-01-28 01:28:53 -05:00
|
|
|
}
|
|
|
|
}
|