table_forum_collectioninvite.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_collectioninvite.php 27779 2012-02-14 07:33:17Z chenmengshu $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_collectioninvite extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_collectioninvite';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function fetch_by_ctid_uid($ctid, $uid) {
  19. return DB::fetch_first('SELECT * FROM %t WHERE ctid=%d AND uid=%d', array($this->_table, $ctid, $uid));
  20. }
  21. public function delete_by_ctid_uid($ctid, $uid) {
  22. $condition = array();
  23. if($ctid) {
  24. $condition[] = DB::field('ctid', $ctid);
  25. }
  26. if($uid) {
  27. $condition[] = DB::field('uid', $uid);
  28. }
  29. if(!count($condition)) {
  30. return false;
  31. }
  32. DB::delete($this->_table, implode(' AND ', $condition));
  33. }
  34. public function delete_by_ctid($ctid) {
  35. return DB::delete($this->_table, DB::field('ctid', $ctid));
  36. }
  37. public function delete_by_dateline($dateline) {
  38. if(!is_numeric($dateline)) {
  39. return false;
  40. }
  41. return DB::delete($this->_table, DB::field('dateline', $dateline, '<='));
  42. }
  43. }
  44. ?>