user.class.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. namespace Shibboleth;
  3. /**
  4. * This file is autogenerated. Do not modifiy it.
  5. */
  6. /**
  7. *
  8. * Model for table user
  9. *
  10. * @license see /license.txt
  11. * @author Laurent Opprecht <laurent@opprecht.info>, Nicolas Rod for the University of Geneva
  12. */
  13. class _User
  14. {
  15. /**
  16. * Store for User objects. Interact with the database.
  17. *
  18. * @return UserStore
  19. */
  20. public static function store()
  21. {
  22. static $result = false;
  23. if (empty($result))
  24. {
  25. $result = new UserStore();
  26. }
  27. return $result;
  28. }
  29. /**
  30. *
  31. * @return User
  32. */
  33. public static function create($data = null)
  34. {
  35. return self::store()->create_object($data);
  36. }
  37. public $user_id = null;
  38. public $lastname = null;
  39. public $firstname = null;
  40. public $username = null;
  41. public $password = null;
  42. public $auth_source = null;
  43. public $shibb_unique_id = null;
  44. public $email = null;
  45. public $status = null;
  46. public $official_code = null;
  47. public $phone = null;
  48. public $picture_uri = null;
  49. public $creator_id = null;
  50. public $competences = null;
  51. public $diplomas = null;
  52. public $openarea = null;
  53. public $teach = null;
  54. public $productions = null;
  55. public $language = null;
  56. public $registration_date = null;
  57. public $expiration_date = null;
  58. public $active = null;
  59. public $openid = null;
  60. public $theme = null;
  61. public $hr_dept_id = null;
  62. public $shibb_persistent_id = null;
  63. /**
  64. *
  65. * @return bool
  66. */
  67. public function save()
  68. {
  69. return self::store()->save($this);
  70. }
  71. }
  72. /**
  73. * Store for User objects. Interact with the database.
  74. *
  75. * @copyright (c) 2012 University of Geneva
  76. * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  77. * @author Laurent Opprecht <laurent@opprecht.info>
  78. */
  79. class _UserStore extends Store
  80. {
  81. /**
  82. *
  83. * @return UserStore
  84. */
  85. public static function instance()
  86. {
  87. static $result = false;
  88. if (empty($result))
  89. {
  90. $result = new self();
  91. }
  92. return $result;
  93. }
  94. public function __construct()
  95. {
  96. parent::__construct('user', '\Shibboleth\User', 'user_id');
  97. }
  98. /**
  99. *
  100. * @return User
  101. */
  102. public function get($w)
  103. {
  104. $args = func_get_args();
  105. $f = array('parent', 'get');
  106. return call_user_func_array($f, $args);
  107. }
  108. /**
  109. *
  110. * @return User
  111. */
  112. public function create_object($data)
  113. {
  114. return parent::create_object($data);
  115. }
  116. /**
  117. *
  118. * @return User
  119. */
  120. public function get_by_user_id($value)
  121. {
  122. return $this->get(array('user_id' => $value));
  123. }
  124. /**
  125. *
  126. * @return bool
  127. */
  128. public function user_id_exists($value)
  129. {
  130. return $this->exist(array('user_id' => $value));
  131. }
  132. /**
  133. *
  134. * @return bool
  135. */
  136. public function delete_by_user_id($value)
  137. {
  138. return $this->delete(array('user_id' => $value));
  139. }
  140. /**
  141. *
  142. * @return User
  143. */
  144. public function get_by_username($value)
  145. {
  146. return $this->get(array('username' => $value));
  147. }
  148. /**
  149. *
  150. * @return bool
  151. */
  152. public function username_exists($value)
  153. {
  154. return $this->exist(array('username' => $value));
  155. }
  156. /**
  157. *
  158. * @return bool
  159. */
  160. public function delete_by_username($value)
  161. {
  162. return $this->delete(array('username' => $value));
  163. }
  164. }