1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
22:
23: use Xoops\Core\Database\Connection;
24: use Xoops\Core\Kernel\XoopsObject;
25: use Xoops\Core\Kernel\XoopsPersistableObjectHandler;
26:
27: class BannersBannerclient extends XoopsObject
28: {
29: 30: 31:
32: public function __construct()
33: {
34: $this->initVar('bannerclient_cid', XOBJ_DTYPE_INT, null, false, 5);
35: $this->initVar('bannerclient_uid', XOBJ_DTYPE_INT, 0, true);
36: $this->initVar('bannerclient_name', XOBJ_DTYPE_TXTBOX, null, false);
37: $this->initVar('bannerclient_extrainfo', XOBJ_DTYPE_TXTAREA, null, false);
38: }
39: public function get_new_id()
40: {
41: return Xoops::getInstance()->db()->lastInsertId();
42: }
43: }
44:
45: class BannersBannerclientHandler extends XoopsPersistableObjectHandler
46: {
47: 48: 49:
50: public function __construct(Connection $db = null)
51: {
52: parent::__construct($db, 'banners_bannerclient', 'BannersBannerclient', 'bannerclient_cid', 'bannerclient_name');
53: }
54: }
55: