ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTimingPlaned Class Reference

class ilTimingPlaned More...

+ Collaboration diagram for ilTimingPlaned:

Public Member Functions

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

Static Public Member Functions

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

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $item_id = 0
 
int $user_id = 0
 
int $start = 0
 
int $end = 0
 

Detailed Description

class ilTimingPlaned

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

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

Constructor & Destructor Documentation

◆ __construct()

ilTimingPlaned::__construct ( int  $item_id,
int  $a_usr_id 
)

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

34 {
35 global $DIC;
36
37 $this->db = $DIC->database();
38
39 $this->item_id = $item_id;
40 $this->user_id = $a_usr_id;
41 $this->__read();
42 }
global $DIC
Definition: shib_login.php:26

References $DIC, $item_id, and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingPlaned::__read ( )

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

169 : void
170 {
171 $query = "SELECT * FROM crs_timings_planed " .
172 "WHERE item_id = " . $this->db->quote($this->getItemId(), 'integer') . " " .
173 "AND usr_id = " . $this->db->quote($this->getUserId(), 'integer') . " ";
174 $res = $this->db->query($query);
175 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
176 $this->setPlanedStartingTime((int) $row->planed_start);
177 $this->setPlanedEndingTime((int) $row->planed_end);
178 }
179 }
setPlanedEndingTime(int $a_end)
setPlanedStartingTime(int $a_time)
$res
Definition: ltiservices.php:69

References $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 ( int  $a_item_id,
int  $a_usr_id 
)
static

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

104 : void
105 {
106 global $DIC;
107
108 $ilDB = $DIC->database();
109 $query = "DELETE FROM crs_timings_planed " .
110 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " " .
111 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
112 $res = $ilDB->manipulate($query);
113 }

References $DIC, $ilDB, and $res.

Referenced by delete(), and update().

+ Here is the caller graph for this function:

◆ _deleteByItem()

static ilTimingPlaned::_deleteByItem ( int  $a_item_id)
static

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

149 : void
150 {
151 global $DIC;
152
153 $ilDB = $DIC->database();
154 $query = "DELETE FROM crs_timings_planed " .
155 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " ";
156 $res = $ilDB->manipulate($query);
157 }

References $DIC, $ilDB, and $res.

◆ _deleteByUser()

static ilTimingPlaned::_deleteByUser ( int  $a_usr_id)
static

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

159 : void
160 {
161 global $DIC;
162
163 $ilDB = $DIC->database();
164 $query = "DELETE FROM crs_timings_planed " .
165 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
166 $res = $ilDB->manipulate($query);
167 }

References $DIC, $ilDB, and $res.

◆ _getPlanedTimings()

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

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

115 : array
116 {
117 global $DIC;
118
119 $ilDB = $DIC->database();
120
121 $query = "SELECT * FROM crs_timings_planed " .
122 "WHERE item_id = " . $ilDB->quote($a_item_id, 'integer') . " " .
123 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
124 $res = $ilDB->query($query);
125 $data = [];
126 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
127 $data['planed_start'] = (int) $row->planed_start;
128 $data['planed_end'] = (int) $row->planed_end;
129 }
130 return $data;
131 }

References $data, $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ _getPlanedTimingsByItem()

static ilTimingPlaned::_getPlanedTimingsByItem (   $a_item_id)
static

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

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

References $data, $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

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

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

◆ create()

ilTimingPlaned::create ( )

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

87 : void
88 {
89 $query = "INSERT INTO crs_timings_planed (item_id,usr_id,planed_start,planed_end) " .
90 "VALUES( " .
91 $this->db->quote($this->getItemId(), 'integer') . ", " .
92 $this->db->quote($this->getUserId(), 'integer') . ", " .
93 $this->db->quote($this->getPlanedStartingTime(), 'integer') . ", " .
94 $this->db->quote($this->getPlanedEndingTime(), 'integer') . " " .
95 ")";
96 $res = $this->db->manipulate($query);
97 }

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

99 : void
100 {
101 ilTimingPlaned::_delete($this->getItemId(), $this->getUserId());
102 }
static _delete(int $a_item_id, int $a_usr_id)

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

+ Here is the call graph for this function:

◆ getItemId()

ilTimingPlaned::getItemId ( )

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

49 : int
50 {
51 return $this->item_id;
52 }

References $item_id.

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

+ Here is the caller graph for this function:

◆ getPlanedEndingTime()

ilTimingPlaned::getPlanedEndingTime ( )

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

64 : int
65 {
66 return $this->end;
67 }

References $end.

Referenced by create().

+ Here is the caller graph for this function:

◆ getPlanedStartingTime()

ilTimingPlaned::getPlanedStartingTime ( )

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

54 : int
55 {
56 return $this->start;
57 }

References $start.

Referenced by create().

+ Here is the caller graph for this function:

◆ getUserId()

ilTimingPlaned::getUserId ( )

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

44 : int
45 {
46 return $this->user_id;
47 }

References $user_id.

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

+ Here is the caller graph for this function:

◆ setPlanedEndingTime()

ilTimingPlaned::setPlanedEndingTime ( int  $a_end)

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

69 : void
70 {
71 $this->end = $a_end;
72 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setPlanedStartingTime()

ilTimingPlaned::setPlanedStartingTime ( int  $a_time)

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

59 : void
60 {
61 $this->start = $a_time;
62 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilTimingPlaned::update ( )

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

80 : bool
81 {
83 $this->create();
84 return true;
85 }

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

+ Here is the call graph for this function:

◆ validate()

ilTimingPlaned::validate ( )

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

74 : bool
75 {
76 $item = ilObjectActivation::getItem($this->getItemId());
77 return true;
78 }
static getItem(int $ref_id)

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

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilTimingPlaned::$db
protected

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

◆ $end

int ilTimingPlaned::$end = 0
private

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

Referenced by getPlanedEndingTime().

◆ $item_id

int ilTimingPlaned::$item_id = 0
private

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

Referenced by __construct(), and getItemId().

◆ $start

int ilTimingPlaned::$start = 0
private

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

Referenced by getPlanedStartingTime().

◆ $user_id

int ilTimingPlaned::$user_id = 0
private

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

Referenced by getUserId().


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