Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezstatus.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezstatus.php 7992 2001-10-22 09:22:31Z $
5 //
6 // Definition of eZStatus class
7 //
8 // Created on: <28-Mar-2001 21:00:00 ce>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
31
35 class eZStatus
36 {
40 function __construct( $id = -1 )
41 {
42 if ( $id != -1 )
43 {
44 $this->ID = $id;
45 $this->get( $this->ID );
46 }
47 }
48
53 function store()
54 {
55 $db =& eZDB::globalDatabase();
56 $db->begin();
57 $name = $db->escapeString( $this->Name );
58 $description = $db->escapeString( $this->Description );
59
60 if ( !isset( $this->ID ) )
61 {
62 $db->lock( "eZTodo_Status" );
63 $this->ID = $db->nextID( "eZTodo_Status", "ID" );
64 $res[] = $db->query( "INSERT INTO eZTodo_Status
65 (ID, Name, Description)
66 VALUES
67 ('$this->ID', '$name', '$description')" );
68 $db->unlock();
69 }
70 else
71 {
72 $res[] = $db->query( "UPDATE eZTodo_Status SET
73 ID='$this->ID',
74 Name='$name',
75 Description='$description'
76 WHERE ID='$this->ID' ");
77 }
78 eZDB::finish( $res, $db );
79 return true;
80 }
81
82
86 function delete()
87 {
88 $db =& eZDB::globalDatabase();
89 $db->begin();
90 $res[] = $db->query( "DELETE FROM eZTodo_Status WHERE ID='$this->ID'" );
91 eZDB::finish( $res, $db );
92 return true;
93 }
94
98 function get( $id )
99 {
100 $db =& eZDB::globalDatabase();
101 $ret = false;
102
103 if ( $id != "" )
104 {
105 $db->array_query( $status_array, "SELECT * FROM eZTodo_Status WHERE ID='$id'" );
106 if ( count( $status_array ) > 1 )
107 {
108 die( "Error: More then one status with the same ID was found in the database. This shouldent happen." );
109 }
110 else if ( count( $status_array ) == 1 )
111 {
112 $this->ID = $status_array[0][$db->fieldName( "ID" )];
113 $this->Name = $status_array[0][$db->fieldName( "Name" )];
114 $this->Description = $status_array[0][$db->fieldName( "Description" )];
115 $ret = true;
116 }
117 }
118
119 return $ret;
120 }
121
126 function getAll()
127 {
128 $db =& eZDB::globalDatabase();
129
130 $status_array = 0;
131
132 $return_array = array();
133 $status_array = array();
134
135 $db->array_query( $status_array, "SELECT ID FROM eZTodo_Status ORDER by Name" );
136
137 for ( $i = 0; $i < count( $status_array ); $i++ )
138 {
139 $return_array[$i] = new eZStatus( $status_array[$i][$db->fieldName( "ID" )], 0 );
140 }
141 return $return_array;
142 }
143
148 function name()
149 {
150 return htmlspecialchars( $this->Name );
151 }
152
157 function setName( $value )
158 {
159 $this->Name = $value;
160 }
161
166 function description()
167 {
168 return htmlspecialchars( $this->Description );
169 }
170
175 function setDescription( $value )
176 {
177 $this->Description = $value;
178 }
179
184 function id()
185 {
186 return $this->ID;
187 }
188
189 var $ID;
190 var $Name;
191 var $Description;
192 }
193
194 ?>
$i
$i
Definition: admin/adlist.php:91
eZDB\finish
static finish(&$resultArray, &$db)
Definition: ezdb.php:204
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZStatus
Definition: ezstatus.php:36
eZStatus\__construct
__construct( $id=-1)
Definition: ezstatus.php:40
eZStatus\name
name()
Definition: ezstatus.php:148
eZStatus\$Description
$Description
Definition: ezstatus.php:191
eZStatus\setName
setName( $value)
Definition: ezstatus.php:157
eZStatus\id
id()
Definition: ezstatus.php:184
eZStatus\getAll
getAll()
Definition: ezstatus.php:126
eZStatus\store
store()
Definition: ezstatus.php:53
eZStatus\description
description()
Definition: ezstatus.php:166
eZStatus\$ID
$ID
Definition: ezstatus.php:189
eZStatus\setDescription
setDescription( $value)
Definition: ezstatus.php:175
eZStatus\$Name
$Name
Definition: ezstatus.php:190
$name
$name
Definition: companytypelist.php:194
$id
$id
Definition: companytypelist.php:193
$db
$db
Definition: ezarticle/user/authorlist.php:53
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$res
$res
Definition: ezstats/admin/cron.php:45
Name
if($user) if(isset( $next) && $next)<?=isset($all_fields_error) &&$all_fields_error ?><?=isset($password_error) &&$password_error ?></p ><? endif;?>< form method="post">< table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">< tr >< td style="color:<?= isset( $error['first_name'] ) ?> First Name
Definition: step1.php:127
$status_array
$status_array
Definition: todoedit.php:645
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.