1 <?php
2 /* --------------------------------------------------------------
3 CustomerCountryZoneRepositoryInterface.inc.php 2015-02-18 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2015 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Interface CustomerCountryZoneRepositoryInterface
14 *
15 * @category System
16 * @package Customer
17 * @subpackage Interfaces
18 */
19 interface CustomerCountryZoneRepositoryInterface
20 {
21
22 /**
23 * Method to get a country zone with a given ID
24 *
25 * @param IdType $countryZoneId
26 *
27 * @throws Exception if country zone not found
28 *
29 * @return CustomerCountryZoneInterface
30 */
31 public function getById(IdType $countryZoneId);
32
33
34 /**
35 * Method to get a county zone with a given name and country
36 *
37 * @param CustomerCountryZoneNameInterface $countryZoneName
38 * @param CustomerCountryInterface $country
39 *
40 * @throws Exception if country zone not found
41 *
42 * @return CustomerCountryZoneInterface
43 */
44 public function getByNameAndCountry(CustomerCountryZoneNameInterface $countryZoneName,
45 CustomerCountryInterface $country);
46
47
48 /**
49 * This method will get the country zone by its name and country if it exists, if not it will return null.
50 *
51 * @param CustomerCountryZoneNameInterface $countryZoneName
52 * @param CustomerCountryInterface $country
53 *
54 * @return CustomerCountryZone|null
55 */
56 public function findByNameAndCountry(CustomerCountryZoneNameInterface $countryZoneName,
57 CustomerCountryInterface $country);
58
59
60 /**
61 * This method will get all country zones by a country ID if it exists, if not it will return an empty array.
62 *
63 * @param IdType $countryId
64 *
65 * @return array
66 */
67 public function findCountryZonesByCountryId(IdType $countryId);
68
69
70 /**
71 * Method to get a country zone by ID if exists else return null
72 *
73 * @param IdType $countryZoneId
74 *
75 * @return CustomerCountryZone|null
76 */
77 public function findById(IdType $countryZoneId);
78
79
80 /**
81 * This method will return a new CustomerCountryZoneName object representing an unknown country zone.
82 * ID is 0 and ISO code is empty.
83 *
84 * @param CustomerCountryZoneNameInterface $countryZoneName
85 *
86 * @return CustomerCountryZone
87 */
88 public function getUnknownCountryZoneByName(CustomerCountryZoneNameInterface $countryZoneName);
89 }