Example #1
0
 function save()
 {
     parent::save();
     $cache = Project::getDatabaseManager()->getCache();
     if ($cache !== null) {
     }
 }
Example #2
0
 function save()
 {
     parent::save();
     $cache = Project::getDatabaseManager()->getCache();
     if ($cache !== null) {
         $cache->delete($this->getCachePrefix('_list_user_type_' . $this->user_type_id));
         $cache->delete($this->getCachePrefix('_list_controller_user_type_' . $this->user_type_id));
         $cache->delete($this->getCachePrefix('_list_controller_action_user_type_' . $this->user_type_id . $this->controller_id . $this->action_id));
     }
 }
Example #3
0
 function loadByKey($controller_id, $key)
 {
     $cache = Project::getDatabaseManager()->getCache();
     if ($cache !== null) {
         $result = $cache->get($this->getCachePrefix('_action_by_key_' . $controller_id . $key));
         if ($result !== null) {
             $this->bind($result);
             return $result;
         }
     }
     $DE = Project::getDatabase();
     $result = array();
     $result = $DE->selectRow("SELECT * FROM " . $this->_table . " WHERE LOWER(name)=LOWER(?) AND controller_id=?d LIMIT 1", $key, (int) $controller_id);
     $this->bind($result);
     if ($cache !== null) {
         $cache->set($this->getCachePrefix('_action_by_key_' . $controller_id . $key), $result);
     }
     return $result;
 }
Example #4
0
 function loadByKey($key)
 {
     $cache = Project::getDatabaseManager()->getCache();
     if ($cache !== null) {
         $result = $cache->get($this->getCachePrefix('_controller_by_key_' . $key));
         if ($result) {
             $this->bind($result);
             return $result;
         }
     }
     $DE = Project::getDatabase();
     $result = array();
     $result = $DE->selectRow("SELECT * FROM " . $this->_table . " WHERE LOWER(request_key)=LOWER(?) LIMIT 1", $key);
     $this->bind($result);
     if ($cache !== null) {
         $cache->set($this->getCachePrefix('_controller_by_key_' . $key), $result);
     }
     return $result;
 }
Example #5
0
 function save()
 {
     if ($this->_load_cache === true) {
         $cache = Project::getDatabaseManager()->getCache();
         if ($cache !== null) {
             if ((int) $this->id > 0) {
                 $cache->delete($this->getCachePrefix('_' . $this->id));
             }
             $cache->delete($this->getCachePrefix('_list'));
         }
     }
     $DE = Project::getDatabase();
     if ((int) $this->id > 0) {
         $DE->query('UPDATE ' . $this->_table . ' SET ?a WHERE id = ?d', $this->_data, $this->id);
     } else {
         $this->id = (int) $DE->query('INSERT INTO ' . $this->_table . ' (?#) VALUES(?a)', array_keys($this->_data), array_values($this->_data));
     }
     return $this->id;
 }