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