XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
bannerclient.php
1<?php
2
3if (!defined('XOOPS_ROOT_PATH')) {
4 exit();
5}
6
8{
9 public $mBanners = [];
10 public $_mBannersLoadedFlag = false;
11
15 public $mFinishBanners = [];
16 public $_mFinishBannersLoadedFlag = false;
17
18 public $mBannerCount = null;
19 public $_mBannerCountLoadedFlag = false;
20
21 public $mFinishBannerCount = null;
22 public $_mFinishBannerCountLoadedFlag = false;
23
24 public function __construct()
25 {
26 static $initVars;
27 if (isset($initVars)) {
28 $this->mVars = $initVars;
29 return;
30 }
31 $this->initVar('cid', XOBJ_DTYPE_INT, '', false);
32 $this->initVar('name', XOBJ_DTYPE_STRING, '', true, 60);
33 $this->initVar('contact', XOBJ_DTYPE_STRING, '', true, 60);
34 $this->initVar('email', XOBJ_DTYPE_STRING, '', true, 60);
35 $this->initVar('login', XOBJ_DTYPE_STRING, '', true, 10);
36 $this->initVar('passwd', XOBJ_DTYPE_STRING, '', true, 10);
37 $this->initVar('extrainfo', XOBJ_DTYPE_TEXT, '', true);
38 $initVars=$this->mVars;
39 }
40
41 public function loadBanner()
42 {
43 if (false == $this->_mBannersLoadedFlag) {
44 $handler =& xoops_getmodulehandler('banner', 'legacyRender');
45 $this->mBanners =& $handler->getObjects(new Criteria('cid', $this->get('cid')));
46 $this->_mBannersLoadedFlag = true;
47 }
48 }
49
50 public function loadBannerCount()
51 {
52 if (false == $this->_mBannerCountLoadedFlag) {
53 $handler =& xoops_getmodulehandler('banner', 'legacyRender');
54 $this->mBannerCount = $handler->getCount(new Criteria('cid', $this->get('cid')));
55 $this->_mBannerCountLoadedFlag = true;
56 }
57 }
58
59 public function &createBanner()
60 {
61 $handler =& xoops_getmodulehandler('banner', 'legacyRender');
62 $obj =& $handler->create();
63 $obj->set('cid', $this->get('cid'));
64 return $obj;
65 }
66
67 public function loadBannerfinish()
68 {
69 if (false == $this->_mFinishBannersLoadedFlag) {
70 $handler =& xoops_getmodulehandler('bannerfinish', 'legacyRender');
71 $this->mFinishBanners =& $handler->getObjects(new Criteria('cid', $this->get('cid')));
72 $this->_mFinishBannersLoadedFlag = true;
73 }
74 }
75
76 public function loadFinishBannerCount()
77 {
78 if (false == $this->_mFinishBannerCountLoadedFlag) {
79 $handler =& xoops_getmodulehandler('bannerfinish', 'legacyRender');
80 $this->mFinishBannerCount = $handler->getCount(new Criteria('cid', $this->get('cid')));
81 $this->_mFinishBannerCountLoadedFlag = true;
82 }
83 }
84
85 public function &createBannerfinish()
86 {
87 $handler =& xoops_getmodulehandler('bannerfinish', 'legacyRender');
88 $obj =& $handler->create();
89 $obj->set('cid', $this->get('cid'));
90 return $obj;
91 }
92}
93
95{
96 public $mTable = 'bannerclient';
97 public $mPrimary = 'cid';
98 public $mClass = 'LegacyRenderBannerclientObject';
99
100 public function delete(&$obj, $force = false)
101 {
102 $handler =& xoops_getmodulehandler('banner', 'legacyRender');
103 $handler->deleteAll(new Criteria('cid', $obj->get('cid')));
104 unset($handler);
105
106 $handler =& xoops_getmodulehandler('bannerfinish', 'legacyRender');
107 $handler->deleteAll(new Criteria('cid', $obj->get('cid')));
108 unset($handler);
109
110 return parent::delete($obj);
111 }
112}