1 <?php
2 /* --------------------------------------------------------------
3 CustomerInputValidatorInterface.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 CustomerInputValidatorInterface
14 *
15 * @category System
16 * @package Customer
17 * @subpackage Interfaces
18 */
19 interface CustomerInputValidatorInterface
20 {
21 /**
22 * Checks if the entered customer's gender is valid.
23 *
24 * @param string $p_gender Customer's gender.
25 *
26 * @return bool Is valid?
27 */
28 public function validateGender($p_gender);
29
30
31 /**
32 * Checks if the entered customer's first name is valid.
33 *
34 * @param string $p_firstname Customer's first name.
35 *
36 * @return bool Is valid?
37 */
38 public function validateFirstname($p_firstname);
39
40
41 /**
42 * Checks if the entered customer's last name is valid.
43 *
44 * @param string $p_lastname Customer's last name.
45 *
46 * @return bool Is valid?
47 */
48 public function validateLastname($p_lastname);
49
50
51 /**
52 * Checks if the entered customer's date of birth is valid.
53 * Valid format is: dd.mm.yyyy
54 *
55 * @param string $p_dateOfBirth Customer's date of birth.
56 *
57 * @return bool Is valid?
58 */
59 public function validateDateOfBirth($p_dateOfBirth);
60
61
62 /**
63 * Checks if the entered customer's company is valid.
64 *
65 * @param string $p_company Customer's company.
66 *
67 * @return bool Is valid?
68 */
69 public function validateCompany($p_company);
70
71
72 /**
73 * Checks if the entered email and email confirmation are valid.
74 * It will check the minimum length, address syntax, confirmation matching and existence of e-mail address.
75 *
76 * @param string $p_email Customer's E-Mail address.
77 * @param string $p_emailConfirmation Confirmation E-Mail address.
78 *
79 * @return bool Is valid?
80 */
81 public function validateEmailAndConfirmation($p_email, $p_emailConfirmation);
82
83
84 /**
85 * Checks if the entered email is valid.
86 *
87 * @param string $p_email Customer's E-Mail address.
88 *
89 * @return bool Is valid?
90 */
91 public function validateEmail($p_email);
92
93
94 /**
95 * Checks if the entered email already exists.
96 *
97 * @param string $p_email Customer's E-Mail address-
98 * @param CustomerInterface $customer Customer.
99 *
100 * @return bool Is valid?
101 */
102 public function validateEmailExists($p_email, CustomerInterface $customer = null);
103
104
105 /**
106 * Checks if the entered street is valid.
107 *
108 * @param string $p_street Customer's street.
109 *
110 * @return bool Is valid?
111 */
112 public function validateStreet($p_street);
113
114
115 /**
116 * Checks if the entered postcode is valid.
117 *
118 * @param string $p_postcode Customer's post code.
119 *
120 * @return bool Is valid?
121 */
122 public function validatePostcode($p_postcode);
123
124
125 /**
126 * Checks if the entered city is valid.
127 *
128 * @param string $p_city Customer's city.
129 *
130 * @return bool Is valid?
131 */
132 public function validateCity($p_city);
133
134
135 /**
136 * Checks if the entered country exists.
137 *
138 * @param int $p_countryId Customer's country ID.
139 *
140 * @return bool Is valid?
141 */
142 public function validateCountry($p_countryId);
143
144
145 /**
146 * Checks if the entered suburb is valid.
147 *
148 * @param $p_suburb Customer's suburb.
149 *
150 * @return bool Is valid?
151 */
152 public function validateSuburb($p_suburb);
153
154
155 /**
156 * Checks if the entered country zone is valid.
157 *
158 * Cases:
159 * - If country has zones: It checks if zone belongs to country.
160 * - If country does not contain zones: It checks the minimum length of zone name.
161 *
162 * @param $p_countryZoneName Customer's country zone name.
163 * @param $p_countryId Customer's country ID.
164 *
165 * @return bool Is valid?
166 */
167 public function validateCountryZone($p_countryZoneName, $p_countryId);
168
169
170 /**
171 * Checks if the entered telephone number is valid.
172 *
173 * @param string $p_telephoneNumber Customer's telephone number.
174 *
175 * @return bool Is valid?
176 */
177 public function validateTelephoneNumber($p_telephoneNumber);
178
179
180 /**
181 * Checks if the entered password is valid.
182 *
183 * @param string $p_password Customer's password.
184 * @param string $p_passwordConfirmation Customer's password confirmation.
185 *
186 * @return bool Is valid?
187 */
188 public function validatePassword($p_password, $p_passwordConfirmation);
189
190
191 /**
192 * Returns error messages.
193 *
194 * @return array Error messages.
195 */
196 public function getErrorMessages();
197
198
199 /**
200 * Returns a collection of error messages.
201 *
202 * @return EditableKeyValueCollection Collection of error messages.
203 */
204 public function getErrorMessageCollection();
205
206
207 /**
208 * Returns the error status.
209 *
210 * @return bool Error status.
211 */
212 public function getErrorStatus();
213 }