ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTimingPlaned Class Reference

class ilTimingPlaned More...

+ Collaboration diagram for ilTimingPlaned:

Public Member Functions

 ilTimingPlaned ($item_id, $a_usr_id)
 
 getUserId ()
 
 getItemId ()
 
 getPlanedStartingTime ()
 
 setPlanedStartingTime ($a_time)
 
 getPlanedEndingTime ()
 
 setPlanedEndingTime ($a_end)
 
 validate ()
 
 update ()
 
 create ()
 
 delete ()
 
 _delete ($a_item_id, $a_usr_id)
 
 _getPlanedTimings ($a_usr_id, $a_item_id)
 
 _getPlanedTimingsByItem ($a_item_id)
 
 _deleteByItem ($a_item_id)
 
 _deleteByUser ($a_usr_id)
 
 __read ()
 

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.

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

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

180 {
181 global $ilDB;
182
183 $query = "SELECT * FROM crs_timings_planed ".
184 "WHERE item_id = ".$ilDB->quote($this->getItemId() ,'integer')." ".
185 "AND usr_id = ".$ilDB->quote($this->getUserId() ,'integer')." ";
186 $res = $this->db->query($query);
187 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
188 {
189 $this->setPlanedStartingTime($row->planed_start);
190 $this->setPlanedEndingTime($row->planed_end);
191 }
192 return true;
193 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setPlanedStartingTime($a_time)

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getItemId(), getUserId(), setPlanedEndingTime(), and setPlanedStartingTime().

Referenced by ilTimingPlaned().

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

◆ _delete()

ilTimingPlaned::_delete (   $a_item_id,
  $a_usr_id 
)

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

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

References $ilDB, $query, and $res.

Referenced by delete(), and update().

+ Here is the caller graph for this function:

◆ _deleteByItem()

ilTimingPlaned::_deleteByItem (   $a_item_id)

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

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

References $ilDB, $query, and $res.

◆ _deleteByUser()

ilTimingPlaned::_deleteByUser (   $a_usr_id)

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

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

References $ilDB, $query, and $res.

◆ _getPlanedTimings()

ilTimingPlaned::_getPlanedTimings (   $a_usr_id,
  $a_item_id 
)

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

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

References $data, $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjectActivation\addAdditionalSubItemInformation().

+ Here is the caller graph for this function:

◆ _getPlanedTimingsByItem()

ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)

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

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

References $data, $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilTimingCache\_getTimings().

+ Here is the caller graph for this function:

◆ create()

ilTimingPlaned::create ( )

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

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

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 113 of file class.ilTimingPlaned.php.

114 {
115 return ilTimingPlaned::_delete($this->getItemId(),$this->getUserId());
116 }
_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 58 of file class.ilTimingPlaned.php.

59 {
60 return $this->item_id;
61 }

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

+ Here is the caller graph for this function:

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

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

72 {
73 return $this->end;
74 }

Referenced by create(), and validate().

+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

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

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

Referenced by create().

+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

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

55 {
56 return $this->user_id;
57 }

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

+ Here is the caller graph for this function:

◆ ilTimingPlaned()

ilTimingPlaned::ilTimingPlaned (   $item_id,
  $a_usr_id 
)

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

41 {
42 global $ilErr,$ilDB,$lng,$tree;
43
44 $this->ilErr =& $ilErr;
45 $this->db =& $ilDB;
46 $this->lng =& $lng;
47
48 $this->item_id = $item_id;
49 $this->user_id = $a_usr_id;
50
51 $this->__read();
52 }

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

+ Here is the call graph for this function:

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime (   $a_end)

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

76 {
77 $this->end = $a_end;
78 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime (   $a_time)

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

68 {
69 $this->start = $a_time;
70 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

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

93 {
95 $this->create();
96 return true;
97 }

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

+ Here is the call graph for this function:

◆ validate()

ilTimingPlaned::validate ( )

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

81 {
82 include_once './Services/Object/classes/class.ilObjectActivation.php';
83 $item = ilObjectActivation::getItem($this->getItemId());
84 // #9326
85 if($this->getPlanedEndingTime() > $item['latest_end'])
86 {
87 return false;
88 }
89 return true;
90 }
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 ilTimingPlaned().

◆ $lng

ilTimingPlaned::$lng

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

Referenced by ilTimingPlaned().


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