ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 type $ilDB. More...
 
 update ()
 Update group information type $ilDB. More...
 
 delete ()
 

Protected Member Functions

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

References read().

22  {
23  $this->group_id = $a_group_id;
24  $this->read();
25  }
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilConsultationHourGroup::delete ( )

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

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

107  {
108  global $DIC;
109 
110  $ilDB = $DIC['ilDB'];
111 
112  $query = 'DELETE FROM cal_ch_group ' .
113  'WHERE grp_id = ' . $ilDB->quote($this->getGroupId(), 'integer');
114  $ilDB->manipulate($query);
115 
116  include_once './Services/Booking/classes/class.ilBookingEntry.php';
118  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
static resetGroup($a_group_id)
Reset booking group (in case of deletion) type $ilDB.
+ 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

type $ilDB

Returns
boolean

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

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

Referenced by __construct().

127  {
128  global $DIC;
129 
130  $ilDB = $DIC['ilDB'];
131 
132  if (!$this->getGroupId()) {
133  return false;
134  }
135  $query = 'SELECT * FROM cal_ch_group ' .
136  'WHERE grp_id = ' . $ilDB->quote($this->getGroupId(), 'integer');
137  $res = $ilDB->query($query);
138  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
139  $this->setUserId($row->usr_id);
140  $this->setTitle($row->title);
141  $this->setMaxAssignments($row->multiple_assignments);
142  }
143  return true;
144  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilConsultationHourGroup::save ( )

Save new group to db type $ilDB.

Returns
int new group id

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

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

69  {
70  global $DIC;
71 
72  $ilDB = $DIC['ilDB'];
73 
74  $this->group_id = $ilDB->nextId('cal_ch_group');
75  $query = 'INSERT INTO cal_ch_group (grp_id,usr_id,multiple_assignments,title) ' .
76  'VALUES ( ' .
77  $ilDB->quote($this->getGroupId(), 'integer') . ', ' .
78  $ilDB->quote($this->getUserId(), 'integer') . ', ' .
79  $ilDB->quote($this->getMaxAssignments(), 'integer') . ', ' .
80  $ilDB->quote($this->getTitle(), 'text') .
81  ')';
82  $ilDB->manipulate($query);
83  return $this->getGroupId();
84  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the call graph for this function:

◆ setMaxAssignments()

ilConsultationHourGroup::setMaxAssignments (   $a_num)

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

Referenced by read().

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

◆ setTitle()

ilConsultationHourGroup::setTitle (   $a_title)

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

Referenced by read().

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

◆ setUserId()

ilConsultationHourGroup::setUserId (   $a_id)

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

Referenced by read().

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

◆ update()

ilConsultationHourGroup::update ( )

Update group information type $ilDB.

Returns
boolean

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

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

92  {
93  global $DIC;
94 
95  $ilDB = $DIC['ilDB'];
96 
97  $query = 'UPDATE cal_ch_group SET ' .
98  'usr_id = ' . $ilDB->quote($this->getUserId(), 'integer') . ', ' .
99  'multiple_assignments = ' . $ilDB->quote($this->getMaxAssignments(), 'integer') . ', ' .
100  'title = ' . $ilDB->quote($this->getTitle(), 'text') . ' ' .
101  'WHERE grp_id = ' . $ilDB->quote($this->getGroupId(), 'integer');
102  $ilDB->manipulate($query);
103  return true;
104  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ 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: