ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 22 of file class.ilConsultationHourGroup.php.

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

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilConsultationHourGroup::delete ( )

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

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

References $ilDB, $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.

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 59 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 38 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 121 of file class.ilConsultationHourGroup.php.

122 {
123 global $ilDB;
124
125 if(!$this->getGroupId())
126 {
127 return false;
128 }
129 $query = 'SELECT * FROM cal_ch_group '.
130 'WHERE grp_id = '.$ilDB->quote($this->getGroupId(),'integer');
131 $res = $ilDB->query($query);
132 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
133 {
134 $this->setUserId($row->usr_id);
135 $this->setTitle($row->title);
136 $this->setMaxAssignments($row->multiple_assignments);
137 }
138 return true;
139 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

References $ilDB, $query, $res, $row, DB_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 69 of file class.ilConsultationHourGroup.php.

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

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

+ Here is the call graph for this function:

◆ setMaxAssignments()

ilConsultationHourGroup::setMaxAssignments (   $a_num)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilConsultationHourGroup::setTitle (   $a_title)

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

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

Referenced by read().

+ Here is the caller graph for this function:

◆ setUserId()

ilConsultationHourGroup::setUserId (   $a_id)

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

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

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 90 of file class.ilConsultationHourGroup.php.

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

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 13 of file class.ilConsultationHourGroup.php.

Referenced by getGroupId().

◆ $num_assignments

ilConsultationHourGroup::$num_assignments = 1
private

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

Referenced by getMaxAssignments().

◆ $title

ilConsultationHourGroup::$title = ''
private

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

Referenced by getTitle().

◆ $usr_id

ilConsultationHourGroup::$usr_id = 0
private

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

Referenced by getUserId().


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