Пример #1
0
 public function loadMeta()
 {
     // Get meta data for loaded content
     if (!$this->id) {
         throw new Exception("Cannot get meta data! No content set!");
         return;
     }
     return Meta::load("content", $this->id);
 }
Пример #2
0
 private function load()
 {
     // Load session data from database
     $sql = new SqlManager();
     $sql->setQuery("SELECT * FROM session WHERE phpkey = '{{id}}'");
     $sql->bindParam("{{id}}", $this->id);
     $this->data = $sql->result();
     if (!isset($this->data['id'])) {
         // No session found, create new session
         $this->create();
     }
     // Load meta data
     $this->data['meta'] = Meta::load("session", $this->data['id']);
     // Hook for post loading manipulations
     $this->data = HookPoint::call("Session.Load", $this->data);
 }
Пример #3
0
 public function load($id)
 {
     // Load user from database
     $sql = new SqlManager();
     $sql->setQuery("SELECT * FROM user WHERE id = {{id}}");
     $sql->bindParam("{{id}}", $id);
     $user = $sql->result();
     if (isset($user['id']) && $user['id'] == $id) {
         $this->id = $id;
         $this->data = $user;
         $this->meta = Meta::load("user", $this->id);
         $this->config = new Config($this->id);
         if (isset($this->meta["usergroup"])) {
             $this->groups = $this->meta["usergroup"];
         }
     }
 }