ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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->crs_id = $crs_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()

ilTimingAccepted::__read ( )

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

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

Referenced by __construct().

161  {
162  global $DIC;
163 
164  $ilDB = $DIC['ilDB'];
165 
166  $query = "SELECT * FROM crs_timings_usr_accept " .
167  "WHERE crs_id = " . $ilDB->quote($this->getCourseId(), 'integer') . " " .
168  "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . "";
169  $res = $this->db->query($query);
170  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
171  $this->setVisible($row->visible);
172  $this->setRemark($row->remark);
173  $this->accept($row->accept);
174  }
175  return true;
176  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
+ 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 126 of file class.ilTimingAccepted.php.

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

Referenced by delete(), and update().

127  {
128  global $DIC;
129 
130  $ilDB = $DIC['ilDB'];
131 
132  $query = "DELETE FROM crs_timings_usr_accept " .
133  "WHERE crs_id = " . $ilDB->quote($a_crs_id, 'integer') . " " .
134  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " ";
135  $res = $ilDB->manipulate($query);
136  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
+ Here is the caller graph for this function:

◆ _deleteByCourse()

ilTimingAccepted::_deleteByCourse (   $a_crs_id)

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

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

139  {
140  global $DIC;
141 
142  $ilDB = $DIC['ilDB'];
143 
144  $query = "DELETE FROM crs_timings_usr_accept " .
145  "WHERE crs_id = " . $ilDB->quote($a_crs_id, 'integer') . " ";
146  $res = $ilDB->manipulate($query);
147  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query

◆ _deleteByUser()

static ilTimingAccepted::_deleteByUser (   $a_usr_id)
static

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

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

150  {
151  global $DIC;
152 
153  $ilDB = $DIC['ilDB'];
154 
155  $query = "DELETE FROM crs_timings_usr_accept " .
156  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . "";
157  $res = $ilDB->manipulate($query);
158  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query

◆ accept()

ilTimingAccepted::accept (   $a_status)

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

Referenced by __read().

73  {
74  $this->accepted = $a_status;
75  }
+ Here is the caller graph for this function:

◆ create()

ilTimingAccepted::create ( )

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

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

Referenced by update().

105  {
106  global $DIC;
107 
108  $ilDB = $DIC['ilDB'];
109 
110  $query = "INSERT INTO crs_timings_usr_accept (crs_id,usr_id,visible,accept,remark) " .
111  "VALUES( " .
112  $ilDB->quote($this->getCourseId(), 'integer') . ", " .
113  $ilDB->quote($this->getUserId(), 'integer') . ", " .
114  $ilDB->quote($this->isVisible(), 'integer') . ", " .
115  $ilDB->quote($this->isAccepted(), 'integer') . ", " .
116  $ilDB->quote($this->getRemark(), 'text') . " " .
117  ")";
118  $res = $ilDB->manipulate($query);
119  }
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()

ilTimingAccepted::delete ( )

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

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

122  {
123  return ilTimingAccepted::_delete($this->getCourseId(), $this->getUserId());
124  }
_delete($a_crs_id, $a_usr_id)
+ Here is the call graph for this function:

◆ getCourseId()

ilTimingAccepted::getCourseId ( )

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

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

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

◆ getRemark()

ilTimingAccepted::getRemark ( )

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

Referenced by create().

85  {
86  return $this->remark;
87  }
+ Here is the caller graph for this function:

◆ getUserId()

ilTimingAccepted::getUserId ( )

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

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

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

◆ isAccepted()

ilTimingAccepted::isAccepted ( )

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

Referenced by create().

77  {
78  return $this->accepted ? true : false;
79  }
+ Here is the caller graph for this function:

◆ isVisible()

ilTimingAccepted::isVisible ( )

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

Referenced by create().

93  {
94  return $this->visible ? true : false;
95  }
+ Here is the caller graph for this function:

◆ setRemark()

ilTimingAccepted::setRemark (   $a_remark)

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

Referenced by __read().

81  {
82  $this->remark = $a_remark;
83  }
+ Here is the caller graph for this function:

◆ setVisible()

ilTimingAccepted::setVisible (   $a_visible)

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

Referenced by __read().

89  {
90  $this->visible = $a_visible;
91  }
+ Here is the caller graph for this function:

◆ update()

ilTimingAccepted::update ( )

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

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

98  {
100  $this->create();
101  return true;
102  }
_delete($a_crs_id, $a_usr_id)
+ 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: