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

Description of class. More...

+ Collaboration diagram for ilConsultationHourGroup:

Public Member Functions

 __construct ($a_group_id=0)
 Constructor. More...
 
 getGroupId ()
 
 setUserId ($a_id)
 
 getUserId ()
 
 setMaxAssignments ($a_num)
 
 getMaxAssignments ()
 
 setTitle ($a_title)
 
 getTitle ()
 
 save ()
 Save new group to db @global type $ilDB. More...
 
 update ()
 Update group information @global type $ilDB. More...
 
 delete ()
 

Protected Member Functions

 read ()
 @global type $ilDB More...
 

Private Attributes

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

Detailed Description

Description of class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilConsultationHourGroup::__construct (   $a_group_id = 0)

Constructor.

Parameters
int$a_group_id

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

22 {
23 $this->group_id = $a_group_id;
24 $this->read();
25 }

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilConsultationHourGroup::delete ( )

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

103 {
104 global $ilDB;
105
106 $query = 'DELETE FROM cal_ch_group ' .
107 'WHERE grp_id = ' . $ilDB->quote($this->getGroupId(), 'integer');
108 $ilDB->manipulate($query);
109
110 include_once './Services/Booking/classes/class.ilBookingEntry.php';
112 }
static resetGroup($a_group_id)
Reset booking group (in case of deletion) @global type $ilDB.
$query
global $ilDB

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

+ Here is the call graph for this function:

◆ getGroupId()

ilConsultationHourGroup::getGroupId ( )

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

References $group_id.

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

+ Here is the caller graph for this function:

◆ getMaxAssignments()

ilConsultationHourGroup::getMaxAssignments ( )

Definition at line 47 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.

References $title.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ getUserId()

ilConsultationHourGroup::getUserId ( )

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

References $usr_id.

Referenced by save(), and update().

+ Here is the caller graph for this function:

◆ read()

ilConsultationHourGroup::read ( )
protected

@global type $ilDB

Returns
boolean

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

121 {
122 global $ilDB;
123
124 if (!$this->getGroupId()) {
125 return false;
126 }
127 $query = 'SELECT * FROM cal_ch_group ' .
128 'WHERE grp_id = ' . $ilDB->quote($this->getGroupId(), 'integer');
129 $res = $ilDB->query($query);
130 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
131 $this->setUserId($row->usr_id);
132 $this->setTitle($row->title);
133 $this->setMaxAssignments($row->multiple_assignments);
134 }
135 return true;
136 }
foreach($_POST as $key=> $value) $res

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

Save new group to db @global type $ilDB.

Returns
int new group id

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

69 {
70 global $ilDB;
71
72 $this->group_id = $ilDB->nextId('cal_ch_group');
73 $query = 'INSERT INTO cal_ch_group (grp_id,usr_id,multiple_assignments,title) ' .
74 'VALUES ( ' .
75 $ilDB->quote($this->getGroupId(), 'integer') . ', ' .
76 $ilDB->quote($this->getUserId(), 'integer') . ', ' .
77 $ilDB->quote($this->getMaxAssignments(), 'integer') . ', ' .
78 $ilDB->quote($this->getTitle(), 'text') .
79 ')';
80 $ilDB->manipulate($query);
81 return $this->getGroupId();
82 }

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

+ Here is the call graph for this function:

◆ setMaxAssignments()

ilConsultationHourGroup::setMaxAssignments (   $a_num)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilConsultationHourGroup::setTitle (   $a_title)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setUserId()

ilConsultationHourGroup::setUserId (   $a_id)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilConsultationHourGroup::update ( )

Update group information @global type $ilDB.

Returns
boolean

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

90 {
91 global $ilDB;
92
93 $query = 'UPDATE cal_ch_group SET ' .
94 'usr_id = ' . $ilDB->quote($this->getUserId(), 'integer') . ', ' .
95 'multiple_assignments = ' . $ilDB->quote($this->getMaxAssignments(), 'integer') . ', ' .
96 'title = ' . $ilDB->quote($this->getTitle(), 'text') . ' ' .
97 'WHERE grp_id = ' . $ilDB->quote($this->getGroupId(), 'integer');
98 $ilDB->manipulate($query);
99 return true;
100 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $group_id

ilConsultationHourGroup::$group_id = 0
private

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

Referenced by getGroupId().

◆ $num_assignments

ilConsultationHourGroup::$num_assignments = 1
private

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

Referenced by getMaxAssignments().

◆ $title

ilConsultationHourGroup::$title = ''
private

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

Referenced by getTitle().

◆ $usr_id

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: