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.

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

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  }
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

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

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

Referenced by __construct().

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  }
foreach($_POST as $key=> $value) $res
$query
setPlanedStartingTime($a_time)
+ 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.

References $ilDB, $query, and $res.

Referenced by delete(), and update().

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  }
foreach($_POST as $key=> $value) $res
$query
+ 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.

References $ilDB, $query, and $res.

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  }
foreach($_POST as $key=> $value) $res
$query

◆ _deleteByUser()

static ilTimingPlaned::_deleteByUser (   $a_usr_id)
static

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

References $ilDB, $query, and $res.

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  }
foreach($_POST as $key=> $value) $res
$query

◆ _getPlanedTimings()

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

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

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

Referenced by ilObjectActivation\addAdditionalSubItemInformation().

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ 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.

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

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

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  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ create()

ilTimingPlaned::create ( )

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

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

Referenced by update().

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  }
foreach($_POST as $key=> $value) $res
$query
+ 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.

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

118  {
119  return ilTimingPlaned::_delete($this->getItemId(), $this->getUserId());
120  }
static _delete($a_item_id, $a_usr_id)
+ Here is the call graph for this function:

◆ getItemId()

ilTimingPlaned::getItemId ( )

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

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

64  {
65  return $this->item_id;
66  }
+ Here is the caller graph for this function:

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

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

References $end.

Referenced by create(), and validate().

77  {
78  return $this->end;
79  }
$end
Definition: saml1-acs.php:18
+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

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

Referenced by create().

69  {
70  return $this->start;
71  }
+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

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

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

60  {
61  return $this->user_id;
62  }
+ Here is the caller graph for this function:

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime (   $a_end)

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

Referenced by __read().

81  {
82  $this->end = $a_end;
83  }
+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime (   $a_time)

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

Referenced by __read(), and ilCourseContentGUI\updateUserTimings().

73  {
74  $this->start = $a_time;
75  }
+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

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

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

97  {
98  ilTimingPlaned::_delete($this->getItemId(), $this->getUserId());
99  $this->create();
100  return true;
101  }
static _delete($a_item_id, $a_usr_id)
+ Here is the call graph for this function:

◆ validate()

ilTimingPlaned::validate ( )

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

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

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