ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC, $ilDB, $ilErr, $lng, $tree, and __read().

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  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

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

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

Referenced by __construct().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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 125 of file class.ilTimingPlaned.php.

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

Referenced by delete(), and update().

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  }
global $DIC
Definition: saml.php:7
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 172 of file class.ilTimingPlaned.php.

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

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query

◆ _deleteByUser()

static ilTimingPlaned::_deleteByUser (   $a_usr_id)
static

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

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

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query

◆ _getPlanedTimings()

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

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

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

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
$data
Definition: bench.php:6

◆ _getPlanedTimingsByItem()

static ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)
static

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

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

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

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
$data
Definition: bench.php:6
+ Here is the caller graph for this function:

◆ create()

ilTimingPlaned::create ( )

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

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

Referenced by update().

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  }
global $DIC
Definition: saml.php:7
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 120 of file class.ilTimingPlaned.php.

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

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

◆ getItemId()

ilTimingPlaned::getItemId ( )

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

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

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

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

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

References $end.

Referenced by create().

82  {
83  return $this->end;
84  }
+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

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

References $start.

Referenced by create().

74  {
75  return $this->start;
76  }
$start
Definition: bench.php:8
+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

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

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

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

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime (   $a_end)

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

Referenced by __read().

86  {
87  $this->end = $a_end;
88  }
+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime (   $a_time)

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

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

78  {
79  $this->start = $a_time;
80  }
+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

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

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

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

◆ validate()

ilTimingPlaned::validate ( )

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

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

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