Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztodolog.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: eztodolog.php 7992 2001-10-22 09:22:31Z $
5 //
6 // eZTodoLog class
7 //
8 // Created on: <30-Apr-2001 14:19:19 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
39 // include_once( "classes/ezdatetime.php" );
40
41 class eZTodoLog
42 {
46 function __construct( $id = -1 )
47 {
48 if ( $id != -1 )
49 {
50 $this->ID = $id;
51 $this->get( $this->ID );
52 }
53 }
54
58 function store()
59 {
60 $db =& eZDB::globalDatabase();
61 $db->begin();
62
63 $log = $db->escapeString( $this->Log );
64
65 $timeStamp =& (new eZDateTime())->timeStamp( true );
66 if ( !isset( $this->ID ) )
67 {
68 $db->lock( "eZTodo_Log" );
69 $this->ID = $db->nextID( "eZTodo_Log", "ID" );
70 $res[] = $db->query( "INSERT INTO eZTodo_Log
71 (ID, Log, Created)
72 VALUES
73 ('$this->ID','$log','$timeStamp')" );
74 $db->unlock();
75 $this->get( $this->ID );
76 }
77 else
78 {
79 $res[] = $db->query( "UPDATE eZTodo_Log SET
80 Log='$log'
81 WHERE ID='$this->ID'" );
82 }
83 eZDB::finish( $res, $db );
84 return true;
85 }
86
90 function delete()
91 {
92 $db =& eZDB::globalDatabase();
93 $db->begin();
94
95 if ( isset( $this->ID ) )
96 {
97 $res[] = $db->query( "DELETE FROM eZTodoLog WHERE UserID='$this->ID'" );
98 }
99 eZDB::finish( $res, $db );
100 return true;
101 }
102
108 function get( $id = -1 )
109 {
110 $db =& eZDB::globalDatabase();
111
112 $ret = false;
113 if ( $id != "" )
114 {
115 $db->array_query( $todoLogArray, "SELECT * FROM eZTodo_Log WHERE ID='$id'",
116 array( "Offset" => 0, "Limit" => 1 ) );
117 if ( count( $todoLogArray ) == 1 )
118 {
119 $this->fill( $todoLogArray[0] );
120 $ret = true;
121 }
122 else if ( count( $todoLogArray ) == 1 )
123 {
124 $this->ID = 0;
125 }
126 }
127 return $ret;
128 }
129
133 function fill( &$user_array )
134 {
135 $db =& eZDB::globalDatabase();
136 $this->ID =& $user_array[$db->fieldName( "ID" )];
137 $this->Log =& $user_array[$db->fieldName( "Log" )];
138 $this->Created =& $user_array[$db->fieldName( "Created" )];
139 }
140
144 function id()
145 {
146 return $this->ID;
147 }
148
152 function log()
153 {
154 return $this->Log;
155 }
156
160 function setLog( $value )
161 {
162 $this->Log = $value;
163 }
164
170 function &created()
171 {
172 $dateTime = new eZDateTime();
173 $dateTime->setTimeStamp( $this->Created );
174
175 return $dateTime;
176 }
177
178 var $ID;
179 var $Log;
180 var $Created;
181 }
182
183 ?>
$dateTime
$dateTime
Definition: authorview.php:77
eZDB\finish
static finish(&$resultArray, &$db)
Definition: ezdb.php:204
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZDateTime
Definition: ezdatetime.php:55
eZTodoLog
Definition: eztodolog.php:42
eZTodoLog\store
store()
Definition: eztodolog.php:58
eZTodoLog\__construct
__construct( $id=-1)
Definition: eztodolog.php:46
eZTodoLog\setLog
setLog( $value)
Definition: eztodolog.php:160
eZTodoLog\$Created
$Created
Definition: eztodolog.php:180
eZTodoLog\id
id()
Definition: eztodolog.php:144
eZTodoLog\log
log()
Definition: eztodolog.php:152
eZTodoLog\created
& created()
Definition: eztodolog.php:170
eZTodoLog\$Log
$Log
Definition: eztodolog.php:179
eZTodoLog\fill
fill(&$user_array)
Definition: eztodolog.php:133
eZTodoLog\$ID
$ID
Definition: eztodolog.php:178
$id
$id
Definition: companytypelist.php:193
$db
$db
Definition: ezarticle/user/authorlist.php:53
$user_array
while( $tmpTime->isGreater( $stopTime)) $user_array
Definition: ezcalendar/user/dayview.php:495
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$res
$res
Definition: ezstats/admin/cron.php:45
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.