ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $ilDB, $ilErr, $lng, and __read().

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  }
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilTimingAccepted::__read ( )

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

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

Referenced by __construct().

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  {
157  $this->setVisible($row->visible);
158  $this->setRemark($row->remark);
159  $this->accept($row->accept);
160  }
161  return true;
162  }
+ 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.

References $ilDB, $query, and $res.

Referenced by delete(), and update().

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  }
+ Here is the caller graph for this function:

◆ _deleteByCourse()

ilTimingAccepted::_deleteByCourse (   $a_crs_id)

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

References $ilDB, $query, and $res.

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  }

◆ _deleteByUser()

static ilTimingAccepted::_deleteByUser (   $a_usr_id)
static

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

References $ilDB, $query, and $res.

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  }

◆ accept()

ilTimingAccepted::accept (   $a_status)

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

Referenced by __read().

68  {
69  $this->accepted = $a_status;
70  }
+ Here is the caller graph for this function:

◆ create()

ilTimingAccepted::create ( )

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

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

Referenced by update().

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  }
+ 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.

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

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

◆ getCourseId()

ilTimingAccepted::getCourseId ( )

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

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

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

◆ getRemark()

ilTimingAccepted::getRemark ( )

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

Referenced by create().

80  {
81  return $this->remark;
82  }
+ Here is the caller graph for this function:

◆ getUserId()

ilTimingAccepted::getUserId ( )

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

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

60  {
61  return $this->user_id;
62  }
+ Here is the caller graph for this function:

◆ isAccepted()

ilTimingAccepted::isAccepted ( )

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

Referenced by create().

72  {
73  return $this->accepted ? true : false;
74  }
+ Here is the caller graph for this function:

◆ isVisible()

ilTimingAccepted::isVisible ( )

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

Referenced by create().

88  {
89  return $this->visible ? true : false;
90  }
+ Here is the caller graph for this function:

◆ setRemark()

ilTimingAccepted::setRemark (   $a_remark)

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

Referenced by __read(), and ilCourseContentGUI\saveAcceptance().

76  {
77  $this->remark = $a_remark;
78  }
+ Here is the caller graph for this function:

◆ setVisible()

ilTimingAccepted::setVisible (   $a_visible)

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

Referenced by __read().

84  {
85  $this->visible = $a_visible;
86  }
+ Here is the caller graph for this function:

◆ update()

ilTimingAccepted::update ( )

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

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

93  {
95  $this->create();
96  return true;
97  }
_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: