ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTimingAccepted Class Reference

class ilTimingAccepted More...

+ Collaboration diagram for ilTimingAccepted:

Public Member Functions

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

Static Public Member Functions

static _deleteByUser ($a_usr_id)
 

Data Fields

 $ilErr
 
 $ilDB
 
 $lng
 

Detailed Description

class ilTimingAccepted

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

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

Constructor & Destructor Documentation

◆ __construct()

ilTimingAccepted::__construct (   $crs_id,
  $a_usr_id 
)

Constructor.

Parameters
int$crs_id
int$a_usr_id

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

46 {
47 global $ilErr,$ilDB,$lng,$tree;
48
49 $this->ilErr =&$ilErr;
50 $this->db =&$ilDB;
51 $this->lng =&$lng;
52
53 $this->crs_id = $crs_id;
54 $this->user_id = $a_usr_id;
55
56 $this->__read();
57 }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingAccepted::__read ( )

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

148 {
149 global $ilDB;
150
151 $query = "SELECT * FROM crs_timings_usr_accept " .
152 "WHERE crs_id = " . $ilDB->quote($this->getCourseId(), 'integer') . " " .
153 "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . "";
154 $res = $this->db->query($query);
155 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
156 $this->setVisible($row->visible);
157 $this->setRemark($row->remark);
158 $this->accept($row->accept);
159 }
160 return true;
161 }
$query
foreach($_POST as $key=> $value) $res

References $ilDB, $query, $res, $row, 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 (   $a_crs_id,
  $a_usr_id 
)

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

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

References $ilDB, $query, and $res.

Referenced by delete(), and update().

+ Here is the caller graph for this function:

◆ _deleteByCourse()

ilTimingAccepted::_deleteByCourse (   $a_crs_id)

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

130 {
131 global $ilDB;
132
133 $query = "DELETE FROM crs_timings_usr_accept " .
134 "WHERE crs_id = " . $ilDB->quote($a_crs_id, 'integer') . " ";
135 $res = $ilDB->manipulate($query);
136 }

References $ilDB, $query, and $res.

◆ _deleteByUser()

static ilTimingAccepted::_deleteByUser (   $a_usr_id)
static

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

139 {
140 global $ilDB;
141
142 $query = "DELETE FROM crs_timings_usr_accept " .
143 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . "";
144 $res = $ilDB->manipulate($query);
145 }

References $ilDB, $query, and $res.

◆ accept()

ilTimingAccepted::accept (   $a_status)

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

68 {
69 $this->accepted = $a_status;
70 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ create()

ilTimingAccepted::create ( )

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

100 {
101 global $ilDB;
102
103 $query = "INSERT INTO crs_timings_usr_accept (crs_id,usr_id,visible,accept,remark) " .
104 "VALUES( " .
105 $ilDB->quote($this->getCourseId(), 'integer') . ", " .
106 $ilDB->quote($this->getUserId(), 'integer') . ", " .
107 $ilDB->quote($this->isVisible(), 'integer') . ", " .
108 $ilDB->quote($this->isAccepted(), 'integer') . ", " .
109 $ilDB->quote($this->getRemark(), 'text') . " " .
110 ")";
111 $res = $ilDB->manipulate($query);
112 }

References $ilDB, $query, $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 114 of file class.ilTimingAccepted.php.

115 {
116 return ilTimingAccepted::_delete($this->getCourseId(), $this->getUserId());
117 }
_delete($a_crs_id, $a_usr_id)

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

+ Here is the call graph for this function:

◆ getCourseId()

ilTimingAccepted::getCourseId ( )

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

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

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

+ Here is the caller graph for this function:

◆ getRemark()

ilTimingAccepted::getRemark ( )

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

80 {
81 return $this->remark;
82 }

Referenced by create().

+ Here is the caller graph for this function:

◆ getUserId()

ilTimingAccepted::getUserId ( )

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

60 {
61 return $this->user_id;
62 }

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

+ Here is the caller graph for this function:

◆ isAccepted()

ilTimingAccepted::isAccepted ( )

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

72 {
73 return $this->accepted ? true : false;
74 }

Referenced by create().

+ Here is the caller graph for this function:

◆ isVisible()

ilTimingAccepted::isVisible ( )

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

88 {
89 return $this->visible ? true : false;
90 }

Referenced by create().

+ Here is the caller graph for this function:

◆ setRemark()

ilTimingAccepted::setRemark (   $a_remark)

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

76 {
77 $this->remark = $a_remark;
78 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setVisible()

ilTimingAccepted::setVisible (   $a_visible)

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

84 {
85 $this->visible = $a_visible;
86 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ update()

ilTimingAccepted::update ( )

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

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

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

+ Here is the call graph for this function:

Field Documentation

◆ $ilDB

ilTimingAccepted::$ilDB

◆ $ilErr

ilTimingAccepted::$ilErr

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

Referenced by __construct().

◆ $lng

ilTimingAccepted::$lng

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

Referenced by __construct().


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