1: <?php
2:
3: namespace Genetsis\core;
4:
5: /**
6: * This class stores user data.
7: *
8: * @package Genetsis
9: * @category Bean
10: * @version 1.0
11: * @access private
12: */
13: class User
14: {
15: /** @var integer Internal user ID (ckusid). */
16: private $id = null;
17: /** @var string User's nickname. */
18: private $nick = null;
19: /** @var string User's e-mail. */
20: private $email = null;
21: /** @var string User's birthday. */
22: private $birthday = null;
23: /** @var boolean Whether if user is agree to receive communications (ARCC) */
24: private $arcc = null;
25: /** @var string The web client where the user was registerd. */
26: private $cw = null;
27: /** @var string The scope or section where the user was registered. */
28: private $section = null;
29: /** @var array Variable vector of user data. */
30: private $user_data = null;
31: /** @var array Variable vector of user identifiers data. */
32: private $user_ids = null;
33: /** @var boolean Whether the user is active */
34: private $active = null;
35: /** @var string user country code */
36: private $country = null;
37: /** @var object Brand user register origin (key, name)*/
38: private $brand = null;
39: /** @var array user tipoligies (customer, client, stakeholder,...) */
40: private $typologies = null;
41: /** @var string hash object id user (new identifier) */
42: private $oid = null;
43: /** @var QueryUserData user Sex */
44: private $sex = null;
45: /** @var QueryUserData user Province */
46: private $province = null;
47:
48: /**
49: * Returns the internal CKUSID of the user.
50: *
51: * @return mixed An integer whether it is been set or NULL otherwise.
52: */
53: public function getId()
54: {
55: return $this->id;
56: }
57:
58: /**
59: * Sets the internal CKUSID of the user.
60: *
61: * @param integer The internal CKUID.
62: */
63: public function setId($id)
64: {
65: $this->id = $id;
66: }
67:
68: /**
69: * Returns the user's nick.
70: *
71: * @return mixed A string or NULL if not been set.
72: */
73: public function getNick()
74: {
75: return $this->nick;
76: }
77:
78: /**
79: * Sets user's nick.
80: *
81: * @param string User's nick.
82: */
83: public function setNick($nick)
84: {
85: $this->nick = $nick;
86: }
87:
88: /**
89: * Returns the user's email.
90: *
91: * @return mixed A string or NULL if not been set.
92: */
93: public function getEmail()
94: {
95: return $this->email;
96: }
97:
98: /**
99: * Sets user's email.
100: *
101: * @param string User's email.
102: */
103: public function setEmail($email)
104: {
105: $this->email = trim((string)$email);
106: }
107:
108: /**
109: * Returns the user's birthday.
110: *
111: * @return mixed A string or NULL if not been set.
112: */
113: public function getBirthday()
114: {
115: return$this->birthday;
116: }
117:
118: /**
119: * Sets user's birthday.
120: *
121: * @param string $birthday User's birthday.
122: */
123: public function setBirthday($birthday)
124: {
125: $this->birthday = trim((string)$birthday);
126: }
127:
128: /**
129: * Returns the user's country.
130: *
131: * @return string
132: */
133: public function getCountry()
134: {
135: return $this->country;
136: }
137:
138: /**
139: * Sets user's country.
140: *
141: * @param string $country
142: */
143: public function setCountry($country)
144: {
145: $this->country = $country;
146: }
147:
148: /**
149: * Returns ARCC (agree to receive communications)
150: *
151: * @return boolean TRUE whether it is agree or FALSE otherwise.
152: */
153: public function getArcc()
154: {
155: return $this->arcc;
156: }
157:
158: /**
159: * Sets ARCC (agree to receive communications)
160: *
161: * @param boolean TRUE whether it is agree or FALSE otherwise.
162: */
163: public function setArcc($arcc)
164: {
165: $this->arcc = $arcc;
166: }
167:
168: /**
169: * Returns user data stored
170: *
171: * @return array A vector which contains user data.
172: */
173: public function getUserData()
174: {
175: return $this->user_data;
176: }
177:
178: /**
179: * Sets user data.
180: *
181: * @param array which contains user data.
182: */
183: public function setUserData($userData)
184: {
185: $this->user_data = $userData;
186: }
187:
188: /**
189: * Returns CW (web client)
190: *
191: * @return string An indentifier for the web client. It could be empty.
192: */
193: public function getCw()
194: {
195: return $this->cw;
196: }
197:
198: /**
199: * Sets the web client.
200: *
201: * @param string An identifier for the web client.
202: */
203: public function setCw($cw)
204: {
205: $this->cw = trim((string)$cw);
206: }
207:
208: /**
209: * Returns the identifier of the section where the user was registered.
210: *
211: * @return string The identifier of the section. It could be empty.
212: */
213: public function getSection()
214: {
215: return $this->section;
216: }
217:
218: /**
219: * The identifier of the section where the user was registered.
220: *
221: * @param string The identifier of the section.
222: */
223: public function setSection($section)
224: {
225: $this->section = trim((string)$section);
226: }
227:
228: /**
229: * Returns the user IDs stored
230: *
231: * @return array Array with the user IDs. It could not be empty.
232: */
233: public function getUserIds()
234: {
235: return $this->user_ids;
236: }
237:
238: /**
239: * Sets the user ID.
240: *
241: * @param mixed An array or string with the user ID.
242: */
243: public function setUserIds($userIds)
244: {
245: $this->user_ids = $userIds;
246: }
247:
248: /**
249: * Returns whether the user is active
250: *
251: * @return boolean TRUE if is active or FALSE otherwise.
252: */
253: public function getActive()
254: {
255: return $this->active;
256: }
257:
258: /**
259: * Sets whether the user is active.
260: *
261: * @param boolean TRUE whether it is active or FALSE otherwise.
262: * @return void
263: */
264: public function setActive($active)
265: {
266: $this->active = $active;
267: }
268:
269: /**
270: * @param object $brand
271: */
272: public function setBrand($brand)
273: {
274: $this->brand = $brand;
275: }
276:
277: /**
278: * @return object
279: */
280: public function getBrand()
281: {
282: return $this->brand;
283: }
284:
285: /**
286: * @param string $oid
287: */
288: public function setOid($oid)
289: {
290: $this->oid = $oid;
291: }
292:
293: /**
294: * @return string
295: */
296: public function getOid()
297: {
298: return $this->oid;
299: }
300:
301: /**
302: * @param \Genetsis\core\QueryUserData $province
303: */
304: public function setProvince($province)
305: {
306: $this->province = $province;
307: }
308:
309: /**
310: * @return \Genetsis\core\QueryUserData
311: */
312: public function getProvince()
313: {
314: return $this->province;
315: }
316:
317: /**
318: * @param \Genetsis\core\QueryUserData $sex
319: */
320: public function setSex($sex)
321: {
322: $this->sex = $sex;
323: }
324:
325: /**
326: * @return \Genetsis\core\QueryUserData
327: */
328: public function getSex()
329: {
330: return $this->sex;
331: }
332:
333: /**
334: * @param array $typologies
335: */
336: public function setTypologies($typologies)
337: {
338: $this->typologies = $typologies;
339: }
340:
341: /**
342: * @return array
343: */
344: public function getTypologies()
345: {
346: return $this->typologies;
347: }
348:
349: }