Advertisement
Guest User

user.php

a guest
Apr 27th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: aicha
  5. * Date: 26/04/2015
  6. * Time: 10:11
  7. */
  8.  
  9. namespace Digitz\Model;
  10. use ZfcUser\Entity\UserInterface;
  11. class user implements UserInterface{
  12.  
  13. public $user_id ;
  14. public $username;
  15. public $password;
  16. public $email ;
  17. public $display_name ;
  18. public $state;
  19.  
  20. public function getId()
  21. {
  22. return $this->user_id;
  23. }
  24.  
  25. public function getPassword()
  26. {
  27. return $this->password;
  28. }
  29.  
  30. public function getState()
  31. {
  32. // TODO: Implement getState() method.
  33. }
  34.  
  35. static function __set_state($an_array)
  36. {
  37. // TODO: Implement __set_state() method.
  38. }
  39.  
  40. public function exchangeArray($data)
  41. {
  42. $this->usr_id = (!empty($data['usr_id'])) ? $data['usr_id'] : null;
  43. $this->username = (!empty($data['username'])) ? $data['username'] : null;
  44. $this->password = (!empty($data['password'])) ? $data['password'] : null;
  45. $this->email = (!empty($data['email'])) ? $data['email'] : null;
  46. $this->display_name = (!empty($data['display_name'])) ? $data['display_name'] : null;
  47. $this->state = (!empty($data['state'])) ? $data['state'] : null;
  48.  
  49. }
  50. public function getArrayCopy()
  51. {
  52. return get_object_vars($this);
  53. }
  54. public function getUsername()
  55. {
  56. return $this->username;
  57. }
  58.  
  59. public function getEmail()
  60. {
  61. return "{$this->getUsername()}@valid.com";
  62. }
  63.  
  64. public function getDisplayName()
  65. {
  66. return $this->getUsername();
  67. }
  68.  
  69. public function setUsername($name)
  70. {
  71. $this->username = $name;
  72. return $this;
  73. }
  74.  
  75.  
  76.  
  77. public function setDisplayName($name)
  78. {
  79. $this->setUsername($name);
  80. }
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement