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