123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <?php
- namespace Shibboleth;
- class _Admin
- {
-
- public static function store()
- {
- static $result = false;
- if (empty($result))
- {
- $result = new AdminStore();
- }
- return $result;
- }
-
-
- public static function create($data = null)
- {
- return self::store()->create_object($data);
- }
- public $user_id = null;
-
-
-
- public function save()
- {
- return self::store()->save($this);
- }
-
- }
- class _AdminStore extends Store
- {
-
- public static function instance()
- {
- static $result = false;
- if (empty($result))
- {
- $result = new self();
- }
- return $result;
- }
-
- public function __construct()
- {
- parent::__construct('admin', '\Shibboleth\Admin', 'user_id');
- }
-
-
- public function get($w)
- {
- $args = func_get_args();
- $f = array('parent', 'get');
- return call_user_func_array($f, $args);
- }
-
-
- public function create_object($data)
- {
- return parent::create_object($data);
- }
-
-
- public function get_by_user_id($value)
- {
- return $this->get(array('user_id' => $value));
- }
-
-
- public function user_id_exists($value)
- {
- return $this->exist(array('user_id' => $value));
- }
-
-
- public function delete_by_user_id($value)
- {
- return $this->delete(array('user_id' => $value));
- }
-
-
- }
|