user.class.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 $chatcall_user_id = null;
  56. public $chatcall_date = null;
  57. public $chatcall_text = null;
  58. public $language = null;
  59. public $registration_date = null;
  60. public $expiration_date = null;
  61. public $active = null;
  62. public $openid = null;
  63. public $theme = null;
  64. public $hr_dept_id = null;
  65. public $shibb_persistent_id = null;
  66. /**
  67. *
  68. * @return bool
  69. */
  70. public function save()
  71. {
  72. return self::store()->save($this);
  73. }
  74. }
  75. /**
  76. * Store for User objects. Interact with the database.
  77. *
  78. * @copyright (c) 2012 University of Geneva
  79. * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  80. * @author Laurent Opprecht <laurent@opprecht.info>
  81. */
  82. class _UserStore extends Store
  83. {
  84. /**
  85. *
  86. * @return UserStore
  87. */
  88. public static function instance()
  89. {
  90. static $result = false;
  91. if (empty($result))
  92. {
  93. $result = new self();
  94. }
  95. return $result;
  96. }
  97. public function __construct()
  98. {
  99. parent::__construct('user', '\Shibboleth\User', 'user_id');
  100. }
  101. /**
  102. *
  103. * @return User
  104. */
  105. public function get($w)
  106. {
  107. $args = func_get_args();
  108. $f = array('parent', 'get');
  109. return call_user_func_array($f, $args);
  110. }
  111. /**
  112. *
  113. * @return User
  114. */
  115. public function create_object($data)
  116. {
  117. return parent::create_object($data);
  118. }
  119. /**
  120. *
  121. * @return User
  122. */
  123. public function get_by_user_id($value)
  124. {
  125. return $this->get(array('user_id' => $value));
  126. }
  127. /**
  128. *
  129. * @return bool
  130. */
  131. public function user_id_exists($value)
  132. {
  133. return $this->exist(array('user_id' => $value));
  134. }
  135. /**
  136. *
  137. * @return bool
  138. */
  139. public function delete_by_user_id($value)
  140. {
  141. return $this->delete(array('user_id' => $value));
  142. }
  143. /**
  144. *
  145. * @return User
  146. */
  147. public function get_by_username($value)
  148. {
  149. return $this->get(array('username' => $value));
  150. }
  151. /**
  152. *
  153. * @return bool
  154. */
  155. public function username_exists($value)
  156. {
  157. return $this->exist(array('username' => $value));
  158. }
  159. /**
  160. *
  161. * @return bool
  162. */
  163. public function delete_by_username($value)
  164. {
  165. return $this->delete(array('username' => $value));
  166. }
  167. }