Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezgroupnoshow.php
Go to the documentation of this file.
1 <?
3 //
4 // Definition of eZGroupNoShow class
5 //
6 // Adam Fallert <FallertA@umsystem.edu>
7 // Created on: <3-Oct-2001 14:36:00>
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License
11 // as published by the Free Software Foundation; either version 2
12 // of the License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
22 //
23
26
30 //include_once( "classes/ezdb.php" );
31 //include_once( "ezuser/classes/ezusergroup.php" );
32
33 class eZGroupNoShow
34 {
41 function __construct( $id=-1, $fetch=true )
42 {
43 $this->IsConnected = false;
44 if ( $id != -1 )
45 {
46 $this->ID = $id;
47 if ( $fetch == true )
48 {
49 $this->get( $this->ID );
50 }
51 else
52 {
53 $this->State_ = "Dirty";
54 }
55 }
56 else
57 {
58 $this->State_ = "New";
59 }
60 }
61
65 function store()
66 {
67 $this->dbInit();
68
69 if ( !isset( $this->ID ) )
70 {
71 $this->Database->query( "INSERT INTO eZGroupEventCalendar_GroupNoShow SET
72 GroupID = '$this->GroupID'" );
73
74 $this->ID = $this->Database->insertID();
75 }
76 else
77 {
78 $this->Database->query( "UPDATE eZGroupEventCalendar_GroupNoShow SET
79 GroupID = '$this->GroupID'
80 WHERE ID='$this->ID'" );
81 }
82
83 return true;
84 }
85
90 function delete()
91 {
92 $this->dbInit();
93
94 if ( isset( $this->ID ) )
95 {
96 $this->Database->query( "DELETE FROM eZGroupEventCalendar_GroupNoShow WHERE ID='$this->ID'" );
97 }
98
99 return true;
100 }
101
105 function get( $id=-1 )
106 {
107 $this->dbInit();
108
109 if ( $id != "" )
110 {
111 $this->Database->array_query( $group_array, "SELECT * FROM eZGroupEventCalendar_GroupNoShow WHERE ID='$id'" );
112
113 $this->ID =& $group_array[0][ "ID" ];
114 $this->GroupID =& $group_array[0][ "GroupID" ];
115
116 $this->State_ = "Coherent";
117
118 }
119 else
120 {
121 $this->State_ = "Dirty";
122 }
123 }
124
125 function getAll()
126 {
127 $this->dbInit();
128
129 $return_array = array();
130 $group_array = array();
131
132 $this->Database->array_query( $group_array, "SELECT * FROM eZGroupEventCalendar_GroupNoShow" );
133
134 if( count( $group_array ) >= 0 )
135 {
136 for( $i=0; $i < count ( $group_array ); $i++ )
137 {
138 $return_array[$i] = new eZGroupNoShow( $group_array[$i]["ID"] );
139 }
140 }
141
142 return $return_array;
143 }
144
148 function groupEntry( $groupID )
149 {
150 $this->dbInit();
151
152 $event_array = array();
153
154 $this->Database->array_query( $group_array, "SELECT ID FROM eZGroupEventCalendar_GroupNoShow WHERE GroupID='$groupID'" );
155
156 if( count( $group_array ) > 0 )
157 return true;
158 else
159 return false;
160 }
161
165 function dumpTable()
166 {
167 $groups = $this->getAll();
168 foreach( $groups as $group )
169 {
170 $delete_group = new eZGroupNoShow( $group->id() );
171 $delete_group->delete();
172 }
173 }
174
178 function id()
179 {
180 return $this->ID;
181 }
182
186 function groupID()
187 {
188 return $this->GroupID;
189 }
190
194 function setGroup( $group )
195 {
196 if ( $this->State_ == "Dirty" )
197 $this->get( $this->ID );
198
199 if ( get_class( $group ) == "ezusergroup" )
200 {
201 $this->GroupID = $group->id();
202 }
203 }
204
209 function dbInit()
210 {
211 if ( $this->IsConnected == false )
212 {
213 $this->Database = eZDB::globalDatabase();
214 $this->IsConnected = true;
215 }
216 }
217
218 var $Database;
219 var $IsConnected;
220 var $ID;
221 var $GroupID;
222 var $State_;
223 }
224
225 ?>
$i
$i
Definition: admin/adlist.php:91
$group
$group
Definition: admin/articleedit.php:799
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZGroupNoShow
Definition: ezgroupnoshow.php:34
eZGroupNoShow\__construct
__construct( $id=-1, $fetch=true)
Definition: ezgroupnoshow.php:41
eZGroupNoShow\$IsConnected
$IsConnected
Definition: ezgroupnoshow.php:219
eZGroupNoShow\groupID
groupID()
Definition: ezgroupnoshow.php:186
eZGroupNoShow\getAll
getAll()
Definition: ezgroupnoshow.php:125
eZGroupNoShow\$State_
$State_
Definition: ezgroupnoshow.php:222
eZGroupNoShow\dumpTable
dumpTable()
Definition: ezgroupnoshow.php:165
eZGroupNoShow\groupEntry
groupEntry( $groupID)
Definition: ezgroupnoshow.php:148
eZGroupNoShow\$ID
$ID
Definition: ezgroupnoshow.php:220
eZGroupNoShow\$Database
$Database
Definition: ezgroupnoshow.php:218
eZGroupNoShow\$GroupID
$GroupID
Definition: ezgroupnoshow.php:221
eZGroupNoShow\store
store()
Definition: ezgroupnoshow.php:65
eZGroupNoShow\setGroup
setGroup( $group)
Definition: ezgroupnoshow.php:194
eZGroupNoShow\dbInit
dbInit()
Definition: ezgroupnoshow.php:209
eZGroupNoShow\id
id()
Definition: ezgroupnoshow.php:178
$id
$id
Definition: companytypelist.php:193
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$groupID
$groupID
Definition: ezgroupeventcalendar/user/dayview.php:90
$group_array
$group_array
Definition: ezgroupeventcalendar/user/dayview.php:836
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.