ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTimingPlaned Class Reference

class ilTimingPlaned More...

+ Collaboration diagram for ilTimingPlaned:

Public Member Functions

 __construct ($item_id, $a_usr_id)
 Constructor. More...
 
 getUserId ()
 
 getItemId ()
 
 getPlanedStartingTime ()
 
 setPlanedStartingTime ($a_time)
 
 getPlanedEndingTime ()
 
 setPlanedEndingTime ($a_end)
 
 validate ()
 
 update ()
 
 create ()
 
 delete ()
 
 __read ()
 

Static Public Member Functions

static _delete ($a_item_id, $a_usr_id)
 
static _getPlanedTimings ($a_usr_id, $a_item_id)
 
static _getPlanedTimingsByItem ($a_item_id)
 
static _deleteByItem ($a_item_id)
 
static _deleteByUser ($a_usr_id)
 

Data Fields

 $ilErr
 
 $ilDB
 
 $lng
 

Detailed Description

class ilTimingPlaned

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 34 of file class.ilTimingPlaned.php.

Constructor & Destructor Documentation

◆ __construct()

ilTimingPlaned::__construct (   $item_id,
  $a_usr_id 
)

Constructor.

Parameters
int$item_id
int$a_usr_id

Definition at line 45 of file class.ilTimingPlaned.php.

46 {
47 global $DIC;
48
49 $ilErr = $DIC['ilErr'];
50 $ilDB = $DIC['ilDB'];
51 $lng = $DIC['lng'];
52 $tree = $DIC['tree'];
53
54 $this->ilErr = &$ilErr;
55 $this->db = &$ilDB;
56 $this->lng = &$lng;
57
58 $this->item_id = $item_id;
59 $this->user_id = $a_usr_id;
60
61 $this->__read();
62 }
$DIC
Definition: xapitoken.php:46

References $DIC, $ilDB, $ilErr, $lng, and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

Definition at line 194 of file class.ilTimingPlaned.php.

195 {
196 global $DIC;
197
198 $ilDB = $DIC['ilDB'];
199
200 $query = "SELECT * FROM crs_timings_planed " .
201 "WHERE item_id = " . $ilDB->quote($this->getItemId(), 'integer') . " " .
202 "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
203 $res = $this->db->query($query);
204 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
205 $this->setPlanedStartingTime($row->planed_start);
206 $this->setPlanedEndingTime($row->planed_end);
207 }
208 return true;
209 }
setPlanedStartingTime($a_time)
$query
foreach($_POST as $key=> $value) $res

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, getItemId(), getUserId(), setPlanedEndingTime(), and setPlanedStartingTime().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _delete()

static ilTimingPlaned::_delete (   $a_item_id,
  $a_usr_id 
)
static

Definition at line 125 of file class.ilTimingPlaned.php.

126 {
127 global $DIC;
128
129 $ilDB = $DIC['ilDB'];
130
131 $query = "DELETE FROM crs_timings_planed " .
132 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " " .
133 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
134 $res = $ilDB->manipulate($query);
135 }

References $DIC, $ilDB, $query, and $res.

Referenced by delete(), and update().

+ Here is the caller graph for this function:

◆ _deleteByItem()

static ilTimingPlaned::_deleteByItem (   $a_item_id)
static

Definition at line 172 of file class.ilTimingPlaned.php.

173 {
174 global $DIC;
175
176 $ilDB = $DIC['ilDB'];
177
178 $query = "DELETE FROM crs_timings_planed " .
179 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " ";
180 $res = $ilDB->manipulate($query);
181 }

References $DIC, $ilDB, $query, and $res.

◆ _deleteByUser()

static ilTimingPlaned::_deleteByUser (   $a_usr_id)
static

Definition at line 183 of file class.ilTimingPlaned.php.

184 {
185 global $DIC;
186
187 $ilDB = $DIC['ilDB'];
188
189 $query = "DELETE FROM crs_timings_planed " .
190 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
191 $res = $ilDB->manipulate($query);
192 }

References $DIC, $ilDB, $query, and $res.

◆ _getPlanedTimings()

static ilTimingPlaned::_getPlanedTimings (   $a_usr_id,
  $a_item_id 
)
static

Definition at line 138 of file class.ilTimingPlaned.php.

139 {
140 global $DIC;
141
142 $ilDB = $DIC['ilDB'];
143
144 $query = "SELECT * FROM crs_timings_planed " .
145 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " " .
146 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
147 $res = $ilDB->query($query);
148 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
149 $data['planed_start'] = $row->planed_start;
150 $data['planed_end'] = $row->planed_end;
151 }
152 return $data ? $data : array();
153 }
$data
Definition: storeScorm.php:23

References $data, $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

◆ _getPlanedTimingsByItem()

static ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)
static

Definition at line 156 of file class.ilTimingPlaned.php.

157 {
158 global $DIC;
159
160 $ilDB = $DIC['ilDB'];
161
162 $query = "SELECT * FROM crs_timings_planed " .
163 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " ";
164 $res = $ilDB->query($query);
165 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
166 $data[$row->usr_id]['start'] = $row->planed_start;
167 $data[$row->usr_id]['end'] = $row->planed_end;
168 }
169 return $data ? $data : array();
170 }

References $data, $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilTimingCache\_getTimings(), and ilTimingCache\readObjectInformation().

+ Here is the caller graph for this function:

◆ create()

ilTimingPlaned::create ( )

Definition at line 104 of file class.ilTimingPlaned.php.

105 {
106 global $DIC;
107
108 $ilDB = $DIC['ilDB'];
109
110 $query = "INSERT INTO crs_timings_planed (item_id,usr_id,planed_start,planed_end) " .
111 "VALUES( " .
112 $ilDB->quote($this->getItemId(), 'integer') . ", " .
113 $ilDB->quote($this->getUserId(), 'integer') . ", " .
114 $ilDB->quote($this->getPlanedStartingTime(), 'integer') . ", " .
115 $ilDB->quote($this->getPlanedEndingTime(), 'integer') . " " .
116 ")";
117 $res = $ilDB->manipulate($query);
118 }

References $DIC, $ilDB, $query, $res, getItemId(), getPlanedEndingTime(), getPlanedStartingTime(), and getUserId().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilTimingPlaned::delete ( )

Definition at line 120 of file class.ilTimingPlaned.php.

121 {
122 return ilTimingPlaned::_delete($this->getItemId(), $this->getUserId());
123 }
static _delete($a_item_id, $a_usr_id)

References _delete(), getItemId(), and getUserId().

+ Here is the call graph for this function:

◆ getItemId()

ilTimingPlaned::getItemId ( )

Definition at line 68 of file class.ilTimingPlaned.php.

69 {
70 return $this->item_id;
71 }

Referenced by __read(), create(), delete(), update(), and validate().

+ Here is the caller graph for this function:

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

Definition at line 81 of file class.ilTimingPlaned.php.

82 {
83 return $this->end;
84 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

Definition at line 73 of file class.ilTimingPlaned.php.

74 {
75 return $this->start;
76 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

Definition at line 64 of file class.ilTimingPlaned.php.

65 {
66 return $this->user_id;
67 }

Referenced by __read(), create(), delete(), and update().

+ Here is the caller graph for this function:

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime (   $a_end)

Definition at line 85 of file class.ilTimingPlaned.php.

86 {
87 $this->end = $a_end;
88 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime (   $a_time)

Definition at line 77 of file class.ilTimingPlaned.php.

78 {
79 $this->start = $a_time;
80 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

Definition at line 97 of file class.ilTimingPlaned.php.

98 {
100 $this->create();
101 return true;
102 }

References _delete(), create(), getItemId(), and getUserId().

+ Here is the call graph for this function:

◆ validate()

ilTimingPlaned::validate ( )

Definition at line 90 of file class.ilTimingPlaned.php.

91 {
92 include_once './Services/Object/classes/class.ilObjectActivation.php';
93 $item = ilObjectActivation::getItem($this->getItemId());
94 return true;
95 }
static getItem($a_ref_id)
Get item data.

References ilObjectActivation\getItem(), and getItemId().

+ Here is the call graph for this function:

Field Documentation

◆ $ilDB

◆ $ilErr

ilTimingPlaned::$ilErr

Definition at line 36 of file class.ilTimingPlaned.php.

Referenced by __construct().

◆ $lng

ilTimingPlaned::$lng

Definition at line 38 of file class.ilTimingPlaned.php.

Referenced by __construct().


The documentation for this class was generated from the following file: