| 1 | <?php |
||
| 13 | class CountryService |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var CountryRepository |
||
| 17 | */ |
||
| 18 | private $countryRepository; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * CountryService constructor. |
||
| 22 | * |
||
| 23 | * @param CountryRepository $countryRepository |
||
| 24 | */ |
||
| 25 | public function __construct(CountryRepository $countryRepository) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Fetches all countries. |
||
| 32 | * |
||
| 33 | * @return CountryEntity[] |
||
| 34 | */ |
||
| 35 | public function fetchAll() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Creates a country in the database. |
||
| 48 | * |
||
| 49 | * @param CountryEntity $entity |
||
| 50 | * |
||
| 51 | * @return CountryEntity |
||
| 52 | */ |
||
| 53 | public function create(CountryEntity $entity) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Update a country in the database. |
||
| 60 | * |
||
| 61 | * @param CountryEntity $entity |
||
| 62 | * |
||
| 63 | * @return CountryEntity |
||
| 64 | */ |
||
| 65 | public function update(CountryEntity $entity) |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Removes a country from the database. |
||
| 72 | * |
||
| 73 | * @param CountryEntity $entity |
||
| 74 | * |
||
| 75 | * @return CountryEntity |
||
| 76 | */ |
||
| 77 | public function remove(CountryEntity $entity) |
||
| 81 | } |
||
| 82 |