ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $ilErr,$ilDB,$lng,$tree;
48
49 $this->ilErr =&$ilErr;
50 $this->db =&$ilDB;
51 $this->lng =&$lng;
52
53 $this->item_id = $item_id;
54 $this->user_id = $a_usr_id;
55
56 $this->__read();
57 }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

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

182 {
183 global $ilDB;
184
185 $query = "SELECT * FROM crs_timings_planed " .
186 "WHERE item_id = " . $ilDB->quote($this->getItemId(), 'integer') . " " .
187 "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
188 $res = $this->db->query($query);
189 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
190 $this->setPlanedStartingTime($row->planed_start);
191 $this->setPlanedEndingTime($row->planed_end);
192 }
193 return true;
194 }
setPlanedStartingTime($a_time)
$query
foreach($_POST as $key=> $value) $res

References $ilDB, $query, $res, $row, 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 122 of file class.ilTimingPlaned.php.

123 {
124 global $ilDB;
125
126 $query = "DELETE FROM crs_timings_planed " .
127 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " " .
128 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
129 $res = $ilDB->manipulate($query);
130 }

References $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 163 of file class.ilTimingPlaned.php.

164 {
165 global $ilDB;
166
167 $query = "DELETE FROM crs_timings_planed " .
168 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " ";
169 $res = $ilDB->manipulate($query);
170 }

References $ilDB, $query, and $res.

◆ _deleteByUser()

static ilTimingPlaned::_deleteByUser (   $a_usr_id)
static

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

173 {
174 global $ilDB;
175
176 $query = "DELETE FROM crs_timings_planed " .
177 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
178 $res = $ilDB->manipulate($query);
179 }

References $ilDB, $query, and $res.

◆ _getPlanedTimings()

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

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

134 {
135 global $ilDB;
136
137 $query = "SELECT * FROM crs_timings_planed " .
138 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " " .
139 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
140 $res = $ilDB->query($query);
141 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
142 $data['planed_start'] = $row->planed_start;
143 $data['planed_end'] = $row->planed_end;
144 }
145 return $data ? $data : array();
146 }

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

Referenced by ilObjectActivation\addAdditionalSubItemInformation().

+ Here is the caller graph for this function:

◆ _getPlanedTimingsByItem()

static ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)
static

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

150 {
151 global $ilDB;
152
153 $query = "SELECT * FROM crs_timings_planed " .
154 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " ";
155 $res = $ilDB->query($query);
156 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
157 $data[$row->usr_id]['start'] = $row->planed_start;
158 $data[$row->usr_id]['end'] = $row->planed_end;
159 }
160 return $data ? $data : array();
161 }

References $data, $ilDB, $query, $res, $row, 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 103 of file class.ilTimingPlaned.php.

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

References $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 117 of file class.ilTimingPlaned.php.

118 {
119 return ilTimingPlaned::_delete($this->getItemId(), $this->getUserId());
120 }
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 63 of file class.ilTimingPlaned.php.

64 {
65 return $this->item_id;
66 }

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

+ Here is the caller graph for this function:

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

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

77 {
78 return $this->end;
79 }
$end
Definition: saml1-acs.php:18

References $end.

Referenced by create(), and validate().

+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

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

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

Referenced by create().

+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

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

60 {
61 return $this->user_id;
62 }

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

+ Here is the caller graph for this function:

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime (   $a_end)

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

81 {
82 $this->end = $a_end;
83 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime (   $a_time)

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

73 {
74 $this->start = $a_time;
75 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

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

97 {
99 $this->create();
100 return true;
101 }

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

+ Here is the call graph for this function:

◆ validate()

ilTimingPlaned::validate ( )

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

86 {
87 include_once './Services/Object/classes/class.ilObjectActivation.php';
88 $item = ilObjectActivation::getItem($this->getItemId());
89 // #9326
90 if ($this->getPlanedEndingTime() > $item['latest_end']) {
91 return false;
92 }
93 return true;
94 }
static getItem($a_ref_id)
Get item data.

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

+ 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: