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

class ilTimingAccepted More...

+ Collaboration diagram for ilTimingAccepted:

Public Member Functions

 __construct (int $crs_id, int $a_usr_id)
 
 getUserId ()
 
 getCourseId ()
 
 accept (bool $a_status)
 
 isAccepted ()
 
 setRemark (string $a_remark)
 
 getRemark ()
 
 setVisible (bool $a_visible)
 
 isVisible ()
 
 update ()
 
 create ()
 
 delete ()
 
 _delete (int $a_crs_id, int $a_usr_id)
 
 _deleteByCourse (int $a_crs_id)
 
 __read ()
 

Static Public Member Functions

static _deleteByUser (int $a_usr_id)
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $obj_id = 0
 
int $user_id = 0
 
bool $visible = false
 
string $remark = ''
 
bool $accepted = false
 

Detailed Description

class ilTimingAccepted

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

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

Constructor & Destructor Documentation

◆ __construct()

ilTimingAccepted::__construct ( int  $crs_id,
int  $a_usr_id 
)

Definition at line 34 of file class.ilTimingAccepted.php.

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

References $DIC, and __read().

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingAccepted::__read ( )

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

133 : void
134 {
135 if ($this->obj_id <= 0 || $this->user_id <= 0) {
136 return;
137 }
138 $query = "SELECT * FROM crs_timings_usr_accept " .
139 "WHERE crs_id = " . $this->db->quote($this->getCourseId(), 'integer') . " " .
140 "AND usr_id = " . $this->db->quote($this->getUserId(), 'integer');
141 $res = $this->db->query($query);
142 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
143 $this->setVisible((bool) $row->visible);
144 $this->setRemark((string) $row->remark);
145 $this->accept((bool) $row->accept);
146 }
147 }
setRemark(string $a_remark)
setVisible(bool $a_visible)
$res
Definition: ltiservices.php:69

References $res, accept(), ilDBConstants\FETCHMODE_OBJECT, getCourseId(), getUserId(), setRemark(), and setVisible().

Referenced by __construct().

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

◆ _delete()

ilTimingAccepted::_delete ( int  $a_crs_id,
int  $a_usr_id 
)

Definition at line 108 of file class.ilTimingAccepted.php.

108 : void
109 {
110 $query = "DELETE FROM crs_timings_usr_accept " .
111 "WHERE crs_id = " . $this->db->quote($a_crs_id, 'integer') . " " .
112 "AND usr_id = " . $this->db->quote($a_usr_id, 'integer') . " ";
113 $res = $this->db->manipulate($query);
114 }

References $res.

Referenced by delete(), and update().

+ Here is the caller graph for this function:

◆ _deleteByCourse()

ilTimingAccepted::_deleteByCourse ( int  $a_crs_id)

Definition at line 116 of file class.ilTimingAccepted.php.

116 : void
117 {
118 $query = "DELETE FROM crs_timings_usr_accept " .
119 "WHERE crs_id = " . $this->db->quote($a_crs_id, 'integer') . " ";
120 $res = $this->db->manipulate($query);
121 }

References $res.

◆ _deleteByUser()

static ilTimingAccepted::_deleteByUser ( int  $a_usr_id)
static

Definition at line 123 of file class.ilTimingAccepted.php.

123 : void
124 {
125 global $DIC;
126
127 $ilDB = $DIC->database();
128 $query = "DELETE FROM crs_timings_usr_accept " .
129 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . "";
130 $res = $ilDB->manipulate($query);
131 }

References $DIC, $ilDB, and $res.

◆ accept()

ilTimingAccepted::accept ( bool  $a_status)

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

54 : void
55 {
56 $this->accepted = $a_status;
57 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ create()

ilTimingAccepted::create ( )

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

90 : void
91 {
92 $query = "INSERT INTO crs_timings_usr_accept (crs_id,usr_id,visible,accept,remark) " .
93 "VALUES( " .
94 $this->db->quote($this->getCourseId(), 'integer') . ", " .
95 $this->db->quote($this->getUserId(), 'integer') . ", " .
96 $this->db->quote($this->isVisible(), 'integer') . ", " .
97 $this->db->quote($this->isAccepted(), 'integer') . ", " .
98 $this->db->quote($this->getRemark(), 'text') . " " .
99 ")";
100 $res = $this->db->manipulate($query);
101 }

References $res, getCourseId(), getRemark(), getUserId(), isAccepted(), and isVisible().

Referenced by update().

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

◆ delete()

ilTimingAccepted::delete ( )

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

103 : void
104 {
106 }
_delete(int $a_crs_id, int $a_usr_id)

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

+ Here is the call graph for this function:

◆ getCourseId()

ilTimingAccepted::getCourseId ( )

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

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

References $obj_id.

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

+ Here is the caller graph for this function:

◆ getRemark()

ilTimingAccepted::getRemark ( )

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

69 : string
70 {
71 return $this->remark;
72 }

References $remark.

Referenced by create().

+ Here is the caller graph for this function:

◆ getUserId()

ilTimingAccepted::getUserId ( )

Definition at line 44 of file class.ilTimingAccepted.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:

◆ isAccepted()

ilTimingAccepted::isAccepted ( )

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

59 : bool
60 {
61 return $this->accepted;
62 }

References $accepted.

Referenced by create().

+ Here is the caller graph for this function:

◆ isVisible()

ilTimingAccepted::isVisible ( )

Definition at line 79 of file class.ilTimingAccepted.php.

79 : bool
80 {
81 return $this->visible;
82 }

References $visible.

Referenced by create().

+ Here is the caller graph for this function:

◆ setRemark()

ilTimingAccepted::setRemark ( string  $a_remark)

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

64 : void
65 {
66 $this->remark = $a_remark;
67 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setVisible()

ilTimingAccepted::setVisible ( bool  $a_visible)

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

74 : void
75 {
76 $this->visible = $a_visible;
77 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilTimingAccepted::update ( )

Definition at line 84 of file class.ilTimingAccepted.php.

84 : void
85 {
87 $this->create();
88 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $accepted

bool ilTimingAccepted::$accepted = false
private

Definition at line 32 of file class.ilTimingAccepted.php.

Referenced by isAccepted().

◆ $db

ilDBInterface ilTimingAccepted::$db
protected

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

◆ $obj_id

int ilTimingAccepted::$obj_id = 0
private

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

Referenced by getCourseId().

◆ $remark

string ilTimingAccepted::$remark = ''
private

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

Referenced by getRemark().

◆ $user_id

int ilTimingAccepted::$user_id = 0
private

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

Referenced by getUserId().

◆ $visible

bool ilTimingAccepted::$visible = false
private

Definition at line 30 of file class.ilTimingAccepted.php.

Referenced by isVisible().


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