PageRenderTime 49ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/library/Pandamp/Modules/Identity/User.php

https://github.com/hukumonline/quart80
PHP | 278 lines | 216 code | 17 blank | 45 comment | 1 complexity | cfbe3a59c23bfbf1dfc380d56f5f27a2 MD5 | raw file
  1. <?php
  2. /**
  3. * A class representing an user in the pandamp application.
  4. *
  5. * @uses Pandamp_BeanContext
  6. * @category Pandamp
  7. * @package Pandamp
  8. * @subpackage User
  9. *
  10. * @author Nihki Prihadi <nihki@madaniyah.com>
  11. */
  12. class Pandamp_Modules_Identity_User implements Pandamp_BeanContext, Serializable {
  13. private $guid;
  14. private $kopel;
  15. private $username;
  16. private $password;
  17. private $fullName;
  18. private $birthday;
  19. private $phone;
  20. private $fax;
  21. private $gender;
  22. private $email;
  23. private $openId;
  24. private $company;
  25. private $address;
  26. private $indexCol;
  27. private $billingAddress;
  28. private $emailBilling;
  29. private $picture;
  30. private $newArticle;
  31. private $weeklyList;
  32. private $monthlyList;
  33. private $packageId;
  34. private $promotionId;
  35. private $educationId;
  36. private $expenseId;
  37. private $paymentId;
  38. private $businessTypeId;
  39. private $periodeId;
  40. private $activationDate;
  41. private $isEmailSent;
  42. private $isEmailSentOver;
  43. private $createdDate;
  44. private $createdBy;
  45. private $updatedDate;
  46. private $updatedBy;
  47. private $isActive;
  48. private $isContact;
  49. /**
  50. * Constructor.
  51. *
  52. */
  53. public function __construct()
  54. {
  55. }
  56. // -------- accessors
  57. public function getId() { return $this->guid; }
  58. public function getKopel() { return $this->kopel; }
  59. public function getUsername() { return $this->username; }
  60. public function getPassword() { return $this->password; }
  61. public function getFullname() { return $this->fullName; }
  62. public function getBirthday() { return $this->birthday; }
  63. public function getPhone() { return $this->phone; }
  64. public function getFax() { return $this->fax; }
  65. public function getGender() { return $this->gender; }
  66. public function getEmail() { return $this->email; }
  67. public function getOpenId() { return $this->openId; }
  68. public function getCompany() { return $this->company; }
  69. public function getAddress() { return $this->address; }
  70. public function getIndexCol() { return $this->indexCol; }
  71. public function getBillingAddress() { return $this->billingAddress; }
  72. public function getEmailBilling() { return $this->emailBilling; }
  73. public function getPicture() { return $this->picture; }
  74. public function getNewArticle() { return $this->newArticle; }
  75. public function getWeeklyList() { return $this->weeklyList; }
  76. public function getMonthlyList() { return $this->monthlyList; }
  77. public function getPackageId() { return $this->packageId; }
  78. public function getPromotionId() { return $this->promotionId; }
  79. public function getEducationId() { return $this->educationId; }
  80. public function getExpenseId() { return $this->expenseId; }
  81. public function getPaymentId() { return $this->paymentId; }
  82. public function getBusinessTypeId() { return $this->businessTypeId; }
  83. public function getPeriodeId() { return $this->periodeId; }
  84. public function getActivationDate() { return $this->activationDate; }
  85. public function getIsEmailSent() { return $this->isEmailSent; }
  86. public function getIsEmailSentOver() { return $this->isEmailSentOver; }
  87. public function getCreatedDate() { return $this->createdDate; }
  88. public function getCreatedBy() { return $this->createdBy; }
  89. public function getUpdatedDate() { return $this->updatedDate; }
  90. public function getUpdatedBy() { return $this->updatedBy; }
  91. public function getIsActive() { return $this->isActive; }
  92. public function getIsContact() { return $this->isContact; }
  93. public function setId($guid) { $this->guid=$guid; }
  94. public function setKopel($kopel) { $this->kopel=$kopel; }
  95. public function setUsername($username) { $this->username=$username; }
  96. public function setPassword($password) { $this->password=$password; }
  97. public function setFullname($fullName) { $this->fullName=$fullName; }
  98. public function setBirthday($birthday) { $this->birthday=$birthday; }
  99. public function setPhone($phone) { $this->phone=$phone; }
  100. public function setFax($phone) { $this->fax=$fax; }
  101. public function setGender($gender) { $this->gender=$gender; }
  102. public function setEmail($email) { $this->email=$email; }
  103. public function setOpenid($openId) { $this->openId=$openId; }
  104. public function setCompany($company) { $this->company=$company; }
  105. public function setAddress($address) { $this->address=$address; }
  106. public function setIndexCol($indexCol) { $this->indexCol=$indexCol; }
  107. public function setBillingAddress($billingAddress) { $this->billingAddress=$billingAddress; }
  108. public function setEmailBilling($emailBilling) { $this->emailBilling=$emailBilling; }
  109. public function setPicture($emailBilling) { $this->picture=$picture; }
  110. public function setNewArticle($newArticle) { $this->newArticle=$newArticle; }
  111. public function setWeeklyList($weeklyList) { $this->weeklyList=$weeklyList; }
  112. public function setMonthlyList($monthlyList) { $this->monthlyList=$monthlyList; }
  113. public function setPackageId($packageId) { $this->packageId=$packageId; }
  114. public function setPromotionId($promotionId) { $this->promotionId=$promotionId; }
  115. public function setEducationId($educationId) { $this->educationId=$educationId; }
  116. public function setExpenseId($expenseId) { $this->expenseId=$expenseId; }
  117. public function setPaymentId($paymentId) { $this->paymentId=$paymentId; }
  118. public function setBusinessTypeId($businessTypeId) { $this->businessTypeId=$businessTypeId; }
  119. public function setPeriodeId($periodeId) { $this->periodeId=$periodeId; }
  120. public function setActivationDate($activationDate) { $this->activationDate=$activationDate; }
  121. public function setIsEmailSent($isEmailSent) { $this->isEmailSent=$isEmailSent; }
  122. public function setIsEmailSentOver($isEmailSentOver) { $this->isEmailSentOver=$isEmailSentOver; }
  123. public function setCreatedDate($createdDate) { $this->createdDate=$createdDate; }
  124. public function setCreatedBy($createdBy) { $this->createdBy=$createdBy; }
  125. public function setUpdatedDate($updatedDate) { $this->updatedDate=$updatedDate; }
  126. public function setUpdatedBy($updatedBy) { $this->updatedBy=$updatedBy; }
  127. public function setIsActive($isActive) { $this->isActive=$isActive; }
  128. public function setIsContact($isContact) { $this->isContact=$isContact; }
  129. // -------- helper
  130. /**
  131. * Returns an associative array, which key/value pairs represent
  132. * the properties stored by this object.
  133. *
  134. * @return array
  135. */
  136. public function toArray()
  137. {
  138. return array(
  139. 'guid' => $this->guid,
  140. 'kopel' => $this->kopel,
  141. 'username' => $this->username,
  142. 'fullName' => $this->fullName,
  143. 'birthday' => $this->birthday,
  144. 'phone' => $this->phone,
  145. 'fax' => $this->fax,
  146. 'gender' => $this->gender,
  147. 'email' => $this->email,
  148. 'company' => $this->company,
  149. 'address' => $this->address,
  150. 'indexCol' => $this->indexCol,
  151. 'billingAddress' => $this->billingAddress,
  152. 'emailBilling' => $this->emailBilling,
  153. 'picture' => $this->picture,
  154. 'newArticle' => $this->newArticle,
  155. 'weeklyList' => $this->weeklyList,
  156. 'monthlyList' => $this->monthlyList,
  157. 'packageId' => $this->packageId,
  158. 'promotionId' => $this->promotionId,
  159. 'educationId' => $this->educationId,
  160. 'expenseId' => $this->expenseId,
  161. 'paymentId' => $this->paymentId,
  162. 'businessTypeId' => $this->businessTypeId,
  163. 'periodeId' => $this->periodeId,
  164. 'activationDate' => $this->activationDate,
  165. 'isEmailSent' => $this->isEmailSent,
  166. 'isEmailSentOver' => $this->isEmailSentOver,
  167. 'createdDate' => $this->createdDate,
  168. 'createdBy' => $this->createdBy,
  169. 'updatedDate' => $this->updatedDate,
  170. 'updatedBy' => $this->updatedBy,
  171. 'isActive' => $this->isActive,
  172. 'isContact' => $this->isContact
  173. );
  174. }
  175. // -------- interface Pandamp_BeanContext
  176. /**
  177. * Serializes properties and returns them as a string which can later on
  178. * be unserialized.
  179. *
  180. * @return string
  181. */
  182. public function serialize()
  183. {
  184. $data = $this->toArray();
  185. return serialize($data);
  186. }
  187. /**
  188. * Unserializes <tt>$serialized</tt> and assigns the specific
  189. * values found to the members in this class.
  190. *
  191. * @param string $serialized The serialized representation of a former
  192. * instance of this class.
  193. */
  194. public function unserialize($serialized)
  195. {
  196. $str = unserialize($serialized);
  197. foreach ($str as $member => $value) {
  198. $this->$member = $value;
  199. }
  200. }
  201. /**
  202. * Returns a Dto for an instance of this class.
  203. *
  204. */
  205. public function getDto()
  206. {
  207. $data = $this->toArray();
  208. $dto = new Pandamp_Modules_Identity_User_Dto();
  209. foreach ($data as $key => $value) {
  210. if (property_exists($dto, $key)) {
  211. $dto->$key = $value;
  212. }
  213. }
  214. return $dto;
  215. }
  216. /**
  217. * Returns a textual representation of the current object.
  218. *
  219. * @return string
  220. */
  221. public function __toString()
  222. {
  223. $data = $this->toArray();
  224. return
  225. 'guid: '.$data['guid'].', '.
  226. 'kopel: '.$data['kopel'].', '.
  227. 'username: '.$data['username'].', '.
  228. 'fullName: '.$data['fullName'].', '.
  229. 'birthday: '.$data['birthday'].', '.
  230. 'phone: '.$data['phone'].', '.
  231. 'fax: '.$data['fax'].', '.
  232. 'gender: '.$data['gender'].', '.
  233. 'email: '.$data['email'].', '.
  234. 'address: '.$data['address'].', '.
  235. 'company: '.$data['company'].', '.
  236. 'indexCol: '.$data['indexCol'].', '.
  237. 'billingAddress: '.$data['billingAddress'].', '.
  238. 'emailBilling: '.$data['emailBilling'].', '.
  239. 'picture: '.$data['picture'].', '.
  240. 'newArticle: '.$data['newArticle'].', '.
  241. 'weeklyList: '.$data['weeklyList'].', '.
  242. 'monthlyList: '.$data['monthlyList'].', '.
  243. 'packageId: '.$data['packageId'].', '.
  244. 'promotionId: '.$data['promotionId'].', '.
  245. 'educationId: '.$data['educationId'].', '.
  246. 'expenseId: '.$data['expenseId'].', '.
  247. 'paymentId: '.$data['paymentId'].', '.
  248. 'businessTypeId: '.$data['businessTypeId'].', '.
  249. 'periodeId: '.$data['periodeId'].', '.
  250. 'activationDate: '.$data['activationDate'].', '.
  251. 'isEmailSent: '.$data['isEmailSent'].', '.
  252. 'isEmailSentOver: '.$data['isEmailSentOver'].', '.
  253. 'createdDate: '.$data['createdDate'].', '.
  254. 'createdBy: '.$data['createdBy'].', '.
  255. 'updatedDate: '.$data['updatedDate'].', '.
  256. 'updatedBy: '.$data['updatedBy'].', '.
  257. 'isActive: '.$data['isActive'].', '.
  258. 'isContact: '.$data['isContact'].';';
  259. }
  260. }
  261. ?>