admin.class.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. namespace Shibboleth;
  3. /**
  4. * This file is autogenerated. Do not modifiy it.
  5. */
  6. /**
  7. *
  8. * Model for table admin
  9. *
  10. * @license see /license.txt
  11. * @author Laurent Opprecht <laurent@opprecht.info>, Nicolas Rod for the University of Geneva
  12. */
  13. class _Admin
  14. {
  15. /**
  16. * Store for Admin objects. Interact with the database.
  17. *
  18. * @return AdminStore
  19. */
  20. public static function store()
  21. {
  22. static $result = false;
  23. if (empty($result))
  24. {
  25. $result = new AdminStore();
  26. }
  27. return $result;
  28. }
  29. /**
  30. *
  31. * @return Admin
  32. */
  33. public static function create($data = null)
  34. {
  35. return self::store()->create_object($data);
  36. }
  37. public $user_id = null;
  38. /**
  39. *
  40. * @return bool
  41. */
  42. public function save()
  43. {
  44. return self::store()->save($this);
  45. }
  46. }
  47. /**
  48. * Store for Admin objects. Interact with the database.
  49. *
  50. * @copyright (c) 2012 University of Geneva
  51. * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  52. * @author Laurent Opprecht <laurent@opprecht.info>
  53. */
  54. class _AdminStore extends Store
  55. {
  56. /**
  57. *
  58. * @return AdminStore
  59. */
  60. public static function instance()
  61. {
  62. static $result = false;
  63. if (empty($result))
  64. {
  65. $result = new self();
  66. }
  67. return $result;
  68. }
  69. public function __construct()
  70. {
  71. parent::__construct('admin', '\Shibboleth\Admin', 'user_id');
  72. }
  73. /**
  74. *
  75. * @return Admin
  76. */
  77. public function get($w)
  78. {
  79. $args = func_get_args();
  80. $f = array('parent', 'get');
  81. return call_user_func_array($f, $args);
  82. }
  83. /**
  84. *
  85. * @return Admin
  86. */
  87. public function create_object($data)
  88. {
  89. return parent::create_object($data);
  90. }
  91. /**
  92. *
  93. * @return Admin
  94. */
  95. public function get_by_user_id($value)
  96. {
  97. return $this->get(array('user_id' => $value));
  98. }
  99. /**
  100. *
  101. * @return bool
  102. */
  103. public function user_id_exists($value)
  104. {
  105. return $this->exist(array('user_id' => $value));
  106. }
  107. /**
  108. *
  109. * @return bool
  110. */
  111. public function delete_by_user_id($value)
  112. {
  113. return $this->delete(array('user_id' => $value));
  114. }
  115. }