| 1 | <?php |
||
| 10 | class CountryService |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var CountryRepository |
||
| 14 | */ |
||
| 15 | private $countryRepository; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * CountryService constructor. |
||
| 19 | * |
||
| 20 | * @param CountryRepository $countryRepository |
||
| 21 | */ |
||
| 22 | public function __construct(CountryRepository $countryRepository) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Fetches all countries. |
||
| 29 | * |
||
| 30 | * @return CountryEntity[] |
||
| 31 | */ |
||
| 32 | public function fetchAll() |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Creates a country in the database. |
||
| 39 | * |
||
| 40 | * @param CountryEntity $entity |
||
| 41 | * |
||
| 42 | * @return CountryEntity |
||
| 43 | */ |
||
| 44 | public function create(CountryEntity $entity) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Update a country in the database. |
||
| 51 | * |
||
| 52 | * @param CountryEntity $entity |
||
| 53 | * |
||
| 54 | * @return CountryEntity |
||
| 55 | */ |
||
| 56 | public function update(CountryEntity $entity) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Removes a country from the database. |
||
| 63 | * |
||
| 64 | * @param CountryEntity $entity |
||
| 65 | * |
||
| 66 | * @return CountryEntity |
||
| 67 | */ |
||
| 68 | public function remove(CountryEntity $entity) |
||
| 72 | } |
||
| 73 |