ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilConsultationHourGroup Class Reference
+ Collaboration diagram for ilConsultationHourGroup:

Public Member Functions

 __construct (int $a_group_id=0)
 
 getGroupId ()
 
 setUserId (int $a_id)
 
 getUserId ()
 
 setMaxAssignments (int $a_num)
 
 getMaxAssignments ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 save ()
 
 update ()
 
 delete ()
 

Protected Member Functions

 read ()
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $group_id = 0
 
int $usr_id = 0
 
int $num_assignments = 1
 
string $title = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilConsultationHourGroup::__construct ( int  $a_group_id = 0)

Definition at line 19 of file class.ilConsultationHourGroup.php.

References $DIC, and read().

20  {
21  global $DIC;
22 
23  $this->db = $DIC->database();
24  $this->group_id = $a_group_id;
25  $this->read();
26  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilConsultationHourGroup::delete ( )

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

References $query, getGroupId(), and ilBookingEntry\resetGroup().

87  : void
88  {
89  $query = 'DELETE FROM cal_ch_group ' .
90  'WHERE grp_id = ' . $this->db->quote($this->getGroupId(), 'integer');
91  $this->db->manipulate($query);
93  }
$query
static resetGroup(int $a_group_id)
Reset booking group (in case of deletion)
+ Here is the call graph for this function:

◆ getGroupId()

ilConsultationHourGroup::getGroupId ( )

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

References $group_id.

Referenced by delete(), read(), save(), and update().

28  : int
29  {
30  return $this->group_id;
31  }
+ Here is the caller graph for this function:

◆ getMaxAssignments()

ilConsultationHourGroup::getMaxAssignments ( )

Definition at line 48 of file class.ilConsultationHourGroup.php.

References $num_assignments.

Referenced by save(), and update().

48  : int
49  {
51  }
+ Here is the caller graph for this function:

◆ getTitle()

ilConsultationHourGroup::getTitle ( )

Definition at line 58 of file class.ilConsultationHourGroup.php.

References $title.

Referenced by save(), and update().

58  : string
59  {
60  return $this->title;
61  }
+ Here is the caller graph for this function:

◆ getUserId()

ilConsultationHourGroup::getUserId ( )

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

References $usr_id.

Referenced by save(), and update().

38  : int
39  {
40  return $this->usr_id;
41  }
+ Here is the caller graph for this function:

◆ read()

ilConsultationHourGroup::read ( )
protected

Definition at line 95 of file class.ilConsultationHourGroup.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, getGroupId(), setMaxAssignments(), setTitle(), and setUserId().

Referenced by __construct().

95  : void
96  {
97  if (!$this->getGroupId()) {
98  return;
99  }
100  $query = 'SELECT * FROM cal_ch_group ' .
101  'WHERE grp_id = ' . $this->db->quote($this->getGroupId(), 'integer');
102  $res = $this->db->query($query);
103  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
104  $this->setUserId((int) $row->usr_id);
105  $this->setTitle($row->title);
106  $this->setMaxAssignments((int) $row->multiple_assignments);
107  }
108  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilConsultationHourGroup::save ( )

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

References $query, getGroupId(), getMaxAssignments(), getTitle(), and getUserId().

63  : int
64  {
65  $this->group_id = $this->db->nextId('cal_ch_group');
66  $query = 'INSERT INTO cal_ch_group (grp_id,usr_id,multiple_assignments,title) ' .
67  'VALUES ( ' .
68  $this->db->quote($this->getGroupId(), 'integer') . ', ' .
69  $this->db->quote($this->getUserId(), 'integer') . ', ' .
70  $this->db->quote($this->getMaxAssignments(), 'integer') . ', ' .
71  $this->db->quote($this->getTitle(), 'text') .
72  ')';
73  $this->db->manipulate($query);
74  return $this->getGroupId();
75  }
$query
+ Here is the call graph for this function:

◆ setMaxAssignments()

ilConsultationHourGroup::setMaxAssignments ( int  $a_num)

Definition at line 43 of file class.ilConsultationHourGroup.php.

Referenced by read().

43  : void
44  {
45  $this->num_assignments = $a_num;
46  }
+ Here is the caller graph for this function:

◆ setTitle()

ilConsultationHourGroup::setTitle ( string  $a_title)

Definition at line 53 of file class.ilConsultationHourGroup.php.

Referenced by read().

53  : void
54  {
55  $this->title = $a_title;
56  }
+ Here is the caller graph for this function:

◆ setUserId()

ilConsultationHourGroup::setUserId ( int  $a_id)

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

Referenced by read().

33  : void
34  {
35  $this->usr_id = $a_id;
36  }
+ Here is the caller graph for this function:

◆ update()

ilConsultationHourGroup::update ( )

Definition at line 77 of file class.ilConsultationHourGroup.php.

References $query, getGroupId(), getMaxAssignments(), getTitle(), and getUserId().

77  : void
78  {
79  $query = 'UPDATE cal_ch_group SET ' .
80  'usr_id = ' . $this->db->quote($this->getUserId(), 'integer') . ', ' .
81  'multiple_assignments = ' . $this->db->quote($this->getMaxAssignments(), 'integer') . ', ' .
82  'title = ' . $this->db->quote($this->getTitle(), 'text') . ' ' .
83  'WHERE grp_id = ' . $this->db->quote($this->getGroupId(), 'integer');
84  $this->db->manipulate($query);
85  }
$query
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilConsultationHourGroup::$db
protected

Definition at line 17 of file class.ilConsultationHourGroup.php.

◆ $group_id

int ilConsultationHourGroup::$group_id = 0
private

Definition at line 12 of file class.ilConsultationHourGroup.php.

Referenced by getGroupId().

◆ $num_assignments

int ilConsultationHourGroup::$num_assignments = 1
private

Definition at line 14 of file class.ilConsultationHourGroup.php.

Referenced by getMaxAssignments().

◆ $title

string ilConsultationHourGroup::$title = ''
private

Definition at line 15 of file class.ilConsultationHourGroup.php.

Referenced by getTitle().

◆ $usr_id

int ilConsultationHourGroup::$usr_id = 0
private

Definition at line 13 of file class.ilConsultationHourGroup.php.

Referenced by getUserId().


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