Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezpriority.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezpriority.php 7992 2001-10-22 09:22:31Z $
5 //
6 // Definition of eZPriority class
7 //
8 // Created on: <04-Sep-2000 16:53:15 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
34 class eZPriority
35 {
37
40 function __construct( $id = -1 )
41 {
42 if ( $id != -1 )
43 {
44 $this->ID = $id;
45 $this->get( $this->ID );
46 }
47 }
48
50
54 function store()
55 {
56 $db =& eZDB::globalDatabase();
57 $db->begin();
58 $name = $db->escapeString( $this->Name );
59 if ( !isset ( $this->ID ) )
60 {
61 $db->lock( "eZTodo_Priority" );
62 $this->ID = $db->nextID( "eZTodo_Priority", "ID" );
63 $res[] = $db->query( "INSERT INTO eZTodo_Priority
64 (ID, Name)
65 VALUES
66 ('$this->ID', '$name')" );
67 $db->unlock();
68 }
69 else
70 {
71 $res[] = $db->query( "UPDATE eZTodo_Priority SET
72 ID='$this->ID',
73 Name='$name'
74 WHERE ID='$this->ID' ");
75 }
76 eZDB::finish( $res, $db );
77 return $this->ID;
78 }
79
81
84 function delete()
85 {
86 $db =& eZDB::globalDatabase();
87 $res[] = $db->query( "DELETE FROM eZTodo_Priority WHERE ID='$this->ID'" );
88 eZDB::finish( $res, $db );
89 }
90
92
95 function get( $id )
96 {
97 $db =& eZDB::globalDatabase();
98 if ( $id != "" )
99 {
100 $db->array_query( $priority_array, "SELECT * FROM eZTodo_Priority WHERE ID='$id'" );
101 if ( count( $priority_array ) > 1 )
102 {
103 die( "Error: Priority's with the same ID was found in the database. This shouldent happen." );
104 }
105 else if ( count( $priority_array ) == 1 )
106 {
107 $this->ID = $priority_array[0][$db->fieldName( "ID" )];
108 $this->Name = $priority_array[0][$db->fieldName( "Name" )];
109
110 $ret = true;
111 }
112 }
113 return $ret;
114 }
115
117
121 function getAll()
122 {
123 $db =& eZDB::globalDatabase();
124 $priority_array = 0;
125
126 $return_array = array();
127 $priority_array = array();
128
129 $db->array_query( $priority_array, "SELECT ID FROM eZTodo_Priority ORDER BY Name" );
130
131 for ( $i = 0; $i < count( $priority_array ); $i++ )
132 {
133 $return_array[$i] = new eZPriority( $priority_array[$i][$db->fieldName( "ID" )], 0 );
134 }
135 return $return_array;
136 }
137
138
140
144 function name()
145 {
146 return htmlspecialchars( $this->Name );
147 }
148
150
154 function setName( $value )
155 {
156 $this->Name = $value;
157 }
158
160
164 function id()
165 {
166 return $this->ID;
167 }
168
169 var $ID;
170 var $Name;
171
172 }
173
174 ?>
$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
eZPriority
Definition: ezpriority.php:35
eZPriority\getAll
getAll()
getAll
Definition: ezpriority.php:121
eZPriority\setName
setName( $value)
setName
Definition: ezpriority.php:154
eZPriority\__construct
__construct( $id=-1)
eZPriority
Definition: ezpriority.php:40
eZPriority\id
id()
id
Definition: ezpriority.php:164
eZPriority\$Name
$Name
Definition: ezpriority.php:170
eZPriority\$ID
$ID
Definition: ezpriority.php:169
eZPriority\name
name()
name
Definition: ezpriority.php:144
eZPriority\store
store()
store
Definition: ezpriority.php:54
$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
$priority_array
$priority_array
Definition: todoedit.php:624
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.