ILIAS  release_8 Revision v8.24
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.

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

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilConsultationHourGroup::delete ( )

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

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 }
static resetGroup(int $a_group_id)
Reset booking group (in case of deletion)
$query

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

+ Here is the call graph for this function:

◆ getGroupId()

ilConsultationHourGroup::getGroupId ( )

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

28 : int
29 {
30 return $this->group_id;
31 }

References $group_id.

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

+ 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().

+ Here is the caller graph for this function:

◆ getTitle()

ilConsultationHourGroup::getTitle ( )

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

58 : string
59 {
60 return $this->title;
61 }

References $title.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getUserId()

ilConsultationHourGroup::getUserId ( )

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

38 : int
39 {
40 return $this->usr_id;
41 }

References $usr_id.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ read()

ilConsultationHourGroup::read ( )
protected

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

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

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

Referenced by __construct().

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

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 }

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

+ Here is the call graph for this function:

◆ setMaxAssignments()

ilConsultationHourGroup::setMaxAssignments ( int  $a_num)

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

43 : void
44 {
45 $this->num_assignments = $a_num;
46 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilConsultationHourGroup::setTitle ( string  $a_title)

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

53 : void
54 {
55 $this->title = $a_title;
56 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setUserId()

ilConsultationHourGroup::setUserId ( int  $a_id)

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

33 : void
34 {
35 $this->usr_id = $a_id;
36 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilConsultationHourGroup::update ( )

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

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 }

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

+ 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: