table_forum_spacecache.php 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: table_forum_spacecache.php 27819 2012-02-15 05:12:23Z svn_project_zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_spacecache extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_spacecache';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function fetch($uid, $variable) {
  19. return DB::fetch_first('SELECT * FROM %t WHERE uid=%d AND variable=%s', array($this->_table, $uid, $variable));
  20. }
  21. public function fetch_all($uids, $variables) {
  22. if(empty($uids) || empty($variables)) {
  23. return array();
  24. }
  25. return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('uid', $uids).' AND '.DB::field('variable', $variables), array($this->_table));
  26. }
  27. public function delete($uid, $variable) {
  28. return DB::query('DELETE FROM %t WHERE uid=%d AND variable=%s', array($this->_table, $uid, $variable));
  29. }
  30. }
  31. ?>