1: <?php
2: /**
3: * XOOPS Kernel Class
4: *
5: * You may not change or alter any portion of this comment or credits
6: * of supporting developers from this source code or any supporting source code
7: * which is considered copyrighted (c) material of the original comment or credit authors.
8: * This program is distributed in the hope that it will be useful,
9: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * @copyright 2000-2015 XOOPS Project (http://xoops.org)
13: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
14: * @package kernel
15: * @since 2.0.0
16: * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
17: */
18:
19: namespace Xoops\Core\Kernel\Handlers;
20:
21: use Xoops\Core\Kernel\Dtype;
22: use Xoops\Core\Kernel\XoopsObject;
23:
24: /**
25: * Private Messages
26: *
27: * @category Xoops\Core\Kernel\Handlers\XoopsPrivateMessage
28: * @package Xoops\Core\Kernel
29: * @author Kazumi Ono <onokazu@xoops.org>
30: * @copyright 2000-2015 XOOPS Project (http://xoops.org)
31: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
32: * @link http://xoops.org
33: */
34: class XoopsPrivateMessage extends XoopsObject
35: {
36: /**
37: * constructor
38: **/
39: public function __construct()
40: {
41: $this->initVar('msg_id', Dtype::TYPE_INTEGER, null, false);
42: $this->initVar('msg_image', Dtype::TYPE_OTHER, null, false, 100);
43: $this->initVar('subject', Dtype::TYPE_TEXT_BOX, null, true, 255);
44: $this->initVar('from_userid', Dtype::TYPE_INTEGER, null, true);
45: $this->initVar('to_userid', Dtype::TYPE_INTEGER, null, true);
46: $this->initVar('msg_time', Dtype::TYPE_OTHER, time(), false);
47: $this->initVar('msg_text', Dtype::TYPE_TEXT_AREA, null, true);
48: $this->initVar('read_msg', Dtype::TYPE_INTEGER, 0, false);
49: }
50:
51: /**
52: * getter
53: *
54: * @param string $format Dtype::FORMAT_xxxx constant
55: *
56: * @return mixed
57: */
58: public function id($format = Dtype::FORMAT_NONE)
59: {
60: return $this->getVar('msg_id', $format);
61: }
62:
63: /**
64: * getter
65: *
66: * @param string $format Dtype::FORMAT_xxxx constant
67: *
68: * @return mixed
69: */
70: public function msg_id($format = '')
71: {
72: return $this->getVar('msg_id', $format);
73: }
74:
75: /**
76: * getter
77: *
78: * @param string $format Dtype::FORMAT_xxxx constant
79: *
80: * @return mixed
81: */
82: public function msg_image($format = '')
83: {
84: return $this->getVar('msg_image', $format);
85: }
86:
87: /**
88: * getter
89: *
90: * @param string $format Dtype::FORMAT_xxxx constant
91: *
92: * @return mixed
93: */
94: public function subject($format = '')
95: {
96: return $this->getVar('subject', $format);
97: }
98:
99: /**
100: * getter
101: *
102: * @param string $format Dtype::FORMAT_xxxx constant
103: *
104: * @return mixed
105: */
106: public function from_userid($format = '')
107: {
108: return $this->getVar('from_userid', $format);
109: }
110:
111: /**
112: * getter
113: *
114: * @param string $format Dtype::FORMAT_xxxx constant
115: *
116: * @return mixed
117: */
118: public function to_userid($format = '')
119: {
120: return $this->getVar('to_userid', $format);
121: }
122:
123: /**
124: * getter
125: *
126: * @param string $format Dtype::FORMAT_xxxx constant
127: *
128: * @return mixed
129: */
130: public function msg_time($format = '')
131: {
132: return $this->getVar('msg_time', $format);
133: }
134:
135: /**
136: * getter
137: *
138: * @param string $format Dtype::FORMAT_xxxx constant
139: *
140: * @return mixed
141: */
142: public function msg_text($format = '')
143: {
144: return $this->getVar('msg_text', $format);
145: }
146:
147: /**
148: * getter
149: *
150: * @param string $format Dtype::FORMAT_xxxx constant
151: *
152: * @return mixed
153: */
154: public function read_msg($format = '')
155: {
156: return $this->getVar('read_msg', $format);
157: }
158: }
159: