Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezorderstatustype.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezorderstatustype.php 6318 2001-07-31 11:33:12Z jhe $
5 //
6 // Definition of eZOrderStatus class
7 //
8 // Created on: <02-Oct-2000 15:06:32 bf>
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
41 // include_once( "classes/ezdb.php" );
42
43 class eZOrderStatusType
44 {
51 function __construct( $id="" )
52 {
53 if ( $id != "" )
54 {
55 $this->ID = $id;
56 $this->get( $this->ID );
57 }
58 }
59
64 function store()
65 {
66 $db =& eZDB::globalDatabase();
67 $db->begin();
68
69 $this->Name = $db->escapeString( $this->Name );
70
71 $ret = false;
72 if ( $this->Name != "" )
73 {
74 if ( !isset( $this->ID ) )
75 {
76 $db->lock( "eZTrade_OrderStatusType" );
77 $nextID = $db->nextID( "eZTrade_OrderStatusType", "ID" );
78 $res[] = $db->query( "INSERT INTO eZTrade_OrderStatusType
79 ( ID,
80 Name )
81 VALUES
82 ( '$nextID'
83 '$this->Name' )" );
84 $db->unlock();
85 $this->ID = $nextID;
86
87 $ret = true;
88 }
89 else
90 {
91 $res[] = $db->query( "UPDATE eZTrade_OrderStatusType SET
92 Name='$this->Name'
93 " );
94
95 $ret = true;
96 }
97 }
98 eZDB::finish( $res, $db );
99 return $ret;
100 }
101
105 function get( $id="" )
106 {
107 $db =& eZDB::globalDatabase();
108 $ret = false;
109
110 if ( $id != "" )
111 {
112 $db->array_query( $status_type_array, "SELECT * FROM eZTrade_OrderStatusType WHERE ID='$id'" );
113 if ( count( $status_type_array ) > 1 )
114 {
115 die( "Error: Status_type's with the same ID was found in the database. This shouldent happen." );
116 }
117 else if( count( $status_type_array ) == 1 )
118 {
119 $this->ID =& $status_type_array[0][$db->fieldName("ID")];
120 $this->Name =& $status_type_array[0][$db->fieldName("Name")];
121
122 $ret = true;
123 }
124 }
125
126 return $ret;
127 }
128
133 function getAll()
134 {
135 $db =& eZDB::globalDatabase();
136 $ret = array();
137
138 $db->array_query( $status_type_array, "SELECT ID FROM eZTrade_OrderStatusType ORDER BY Name" );
139
140 foreach ( $status_type_array as $status_type )
141 {
142 $ret[] = new eZOrderStatusType( $status_type[$db->fieldName("ID")] );
143 }
144 return $ret;
145 }
146
150 function id()
151 {
152 return $this->ID;
153 }
154
158 function name()
159 {
160 return $this->Name;
161 }
162
166 function setName( $value )
167 {
168 $this->Name = $value;
169 }
170
175 function getByName( $name )
176 {
177 $db =& eZDB::globalDatabase();
178 $ret = false;
179 $db->array_query( $value_array, "SELECT ID FROM eZTrade_OrderStatusType WHERE Name='$name'" );
180
181 if ( count( $value_array ) == 1 )
182 {
183 $ret = new eZOrderStatusType( $value_array[0][$db->fieldName( "ID" )] );
184 }
185 else
186 {
187 return false;
188 }
189
190 return $ret;
191 }
192
193 var $ID;
194 var $Name;
195 }
196
197 ?>
eZDB\finish
static finish(&$resultArray, &$db)
Definition: ezdb.php:204
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZOrderStatusType
Definition: ezorderstatustype.php:44
eZOrderStatusType\getAll
getAll()
Definition: ezorderstatustype.php:133
eZOrderStatusType\$Name
$Name
Definition: ezorderstatustype.php:194
eZOrderStatusType\__construct
__construct( $id="")
Definition: ezorderstatustype.php:51
eZOrderStatusType\setName
setName( $value)
Definition: ezorderstatustype.php:166
eZOrderStatusType\$ID
$ID
Definition: ezorderstatustype.php:193
eZOrderStatusType\name
name()
Definition: ezorderstatustype.php:158
eZOrderStatusType\id
id()
Definition: ezorderstatustype.php:150
eZOrderStatusType\getByName
getByName( $name)
Definition: ezorderstatustype.php:175
eZOrderStatusType\store
store()
Definition: ezorderstatustype.php:64
$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
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.