1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: use Xoops\Core\Database\Connection;
13: use Xoops\Core\Kernel\Dtype;
14: use Xoops\Core\Kernel\XoopsObject;
15: use Xoops\Core\Kernel\XoopsPersistableObjectHandler;
16:
17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
27: class UserrankRank extends XoopsObject
28: {
29: 30: 31:
32: public function __construct()
33: {
34: $this->initVar('rank_id', Dtype::TYPE_INTEGER, null, false, 5);
35: $this->initVar('rank_title', Dtype::TYPE_TEXT_BOX, null, false);
36: $this->initVar('rank_min', Dtype::TYPE_INTEGER, null, false, 8);
37: $this->initVar('rank_max', Dtype::TYPE_INTEGER, null, false, 8);
38: $this->initVar('rank_special', Dtype::TYPE_INTEGER, null, false, 1);
39: $this->initVar('rank_image', Dtype::TYPE_TEXT_BOX, null, false);
40: }
41:
42: 43: 44: 45: 46: 47: 48:
49: public function id($format = 'n')
50: {
51: return $this->rank_id($format);
52: }
53:
54: 55: 56: 57: 58: 59: 60:
61: public function rank_id($format = '')
62: {
63: return $this->getVar('rank_id', $format);
64: }
65:
66: 67: 68: 69: 70: 71: 72:
73: public function rank_title($format = '')
74: {
75: return $this->getVar('rank_title', $format);
76: }
77:
78: 79: 80: 81: 82: 83: 84:
85: public function rank_min($format = '')
86: {
87: return $this->getVar('rank_min', $format);
88: }
89:
90: 91: 92: 93: 94: 95: 96:
97: public function rank_max($format = '')
98: {
99: return $this->getVar('rank_max', $format);
100: }
101:
102: 103: 104: 105: 106: 107: 108:
109: public function rank_special($format = '')
110: {
111: return $this->getVar('rank_special', $format);
112: }
113:
114: 115: 116: 117: 118: 119: 120:
121: public function rank_image($format = '')
122: {
123: return $this->getVar('rank_image', $format);
124: }
125: }
126:
127: class UserrankRankHandler extends XoopsPersistableObjectHandler
128: {
129:
130: 131: 132:
133: public function __construct(Connection $db)
134: {
135: parent::__construct($db, 'userrank_rank', 'UserrankRank', 'rank_id', 'rank_title');
136: }
137: }
138: