Container.php
114 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Infrastructure\Common; |
| 4 | |
| 5 | use AmeliaBooking\Domain\Repository\User\UserRepositoryInterface; |
| 6 | use AmeliaBooking\Domain\Services\Logger\LoggerInterface; |
| 7 | use AmeliaBooking\Infrastructure\Connection; |
| 8 | |
| 9 | /** |
| 10 | * Class Container |
| 11 | * |
| 12 | * @package AmeliaBooking\Infrastructure\Common |
| 13 | */ |
| 14 | final class Container extends \Slim\Container |
| 15 | { |
| 16 | /** |
| 17 | * @return Connection |
| 18 | */ |
| 19 | public function getDatabaseConnection() |
| 20 | { |
| 21 | return $this->get('app.connection'); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * @return UserRepositoryInterface |
| 26 | */ |
| 27 | public function getUserRepository() |
| 28 | { |
| 29 | return $this->get('domain.users.repository'); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Get the command bus |
| 34 | * |
| 35 | * @return mixed |
| 36 | */ |
| 37 | public function getCommandBus() |
| 38 | { |
| 39 | return $this->get('command.bus'); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get the event bus |
| 44 | * |
| 45 | * @return mixed |
| 46 | */ |
| 47 | public function getEventBus() |
| 48 | { |
| 49 | return $this->get('domain.event.bus'); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Get the Permissions domain service |
| 54 | * |
| 55 | */ |
| 56 | public function getPermissionsService() |
| 57 | { |
| 58 | return $this->get('domain.permissions.service'); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Get the API Permissions domain service |
| 63 | * |
| 64 | */ |
| 65 | public function getApiPermissionsService() |
| 66 | { |
| 67 | return $this->get('domain.api.permissions.service'); |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Get the API User application service |
| 72 | * |
| 73 | */ |
| 74 | public function getApiUserApplicationService() |
| 75 | { |
| 76 | return $this->get('application.api.user.service'); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Get the User application service |
| 81 | * |
| 82 | */ |
| 83 | public function getUserApplicationService() |
| 84 | { |
| 85 | return $this->get('application.user.service'); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Get the Logger service |
| 90 | * |
| 91 | * @return LoggerInterface |
| 92 | */ |
| 93 | public function getLoggerService() |
| 94 | { |
| 95 | return $this->get('infrastructure.logger'); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * @return mixed |
| 100 | */ |
| 101 | public function getMailerService() |
| 102 | { |
| 103 | return $this->get('application.mailer'); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * @return mixed |
| 108 | */ |
| 109 | public function getSettingsService() |
| 110 | { |
| 111 | return $this->get('domain.settings.service'); |
| 112 | } |
| 113 | } |
| 114 |