ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjSession Class Reference
+ Inheritance diagram for ilObjSession:
+ Collaboration diagram for ilObjSession:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 getPresentationTitle ()
 get title (overwritten from base class) More...
 
 getEventId ()
 sget event id More...
 
 setLocation ($a_location)
 set location More...
 
 getLocation ()
 get location More...
 
 setName ($a_name)
 set name More...
 
 getName ()
 get name More...
 
 setPhone ($a_phone)
 set phone More...
 
 getPhone ()
 get phone More...
 
 setEmail ($a_email)
 set email More...
 
 getEmail ()
 get email More...
 
 hasTutorSettings ()
 check if there any tutor settings More...
 
 setDetails ($a_details)
 set details More...
 
 getDetails ()
 get details More...
 
 enableRegistration ($a_registration)
 enable registration More...
 
 enabledRegistration ()
 is registration enabled More...
 
 getAppointments ()
 get appointments More...
 
 addAppointment ($appointment)
 add appointment More...
 
 setAppointments ($appointments)
 set appointments More...
 
 getFirstAppointment ()
 get first appointment More...
 
 getFiles ()
 get files More...
 
 validate ()
 validate More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone course (no member data) More...
 
 cloneSettings ($new_obj)
 clone settings More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone dependencies. More...
 
 create ()
 create new session More...
 
 update ()
 update object More...
 
 delete ()
 delete session and all related data More...
 
 read ()
 read session data More...
 
 initFiles ()
 init files More...
 
 prepareCalendarAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static _lookupRegistrationEnabled ($a_obj_id)
 lookup registration enabled More...
 
static lookupSession ($a_obj_id)
 Get session data. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const CAL_REG_START = 1
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

 initAppointments ()
 init appointments More...
 

Protected Attributes

 $db
 
 $location
 
 $name
 
 $phone
 
 $email
 
 $details
 
 $registration
 
 $event_id
 
 $appointments
 
 $files = array()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilObjSession::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 39 of file class.ilObjSession.php.

40  {
41  global $ilDB;
42 
43  $this->db = $ilDB;
44  $this->type = "sess";
45  parent::__construct($a_id,$a_call_by_reference);
46  }

Member Function Documentation

◆ _lookupRegistrationEnabled()

static ilObjSession::_lookupRegistrationEnabled (   $a_obj_id)
static

lookup registration enabled

public

Parameters

Definition at line 56 of file class.ilObjSession.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLPStatusEvent\_getStatusInfo(), and ilLPStatusEvent\determineStatus().

57  {
58  global $ilDB;
59 
60  $query = "SELECT registration FROM event ".
61  "WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
62  $res = $ilDB->query($query);
63  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
64  {
65  return (bool) $row->registration;
66  }
67  return false;
68  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ addAppointment()

ilObjSession::addAppointment (   $appointment)

add appointment

public

Parameters
objectilSessionAppointment
Returns

Definition at line 292 of file class.ilObjSession.php.

293  {
294  $this->appointments[] = $appointment;
295  }

◆ cloneDependencies()

ilObjSession::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone dependencies.

Parameters
inttarget id ref_id of new session
intcopy_id
Returns

Definition at line 414 of file class.ilObjSession.php.

References ilObject\getId().

415  {
416  global $ilObjDataCache;
417 
418  parent::cloneDependencies($a_target_id,$a_copy_id);
419 
420  $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
421 
422  include_once('./Modules/Session/classes/class.ilEventItems.php');
423  $session_materials = new ilEventItems($target_obj_id);
424  $session_materials->cloneItems($this->getId(),$a_copy_id);
425 
426  return true;
427  }
getId()
get object id public
class ilEvent
+ Here is the call graph for this function:

◆ cloneObject()

ilObjSession::cloneObject (   $a_target_id,
  $a_copy_id = 0 
)

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

Definition at line 352 of file class.ilObjSession.php.

References $file, $ilUser, cloneSettings(), getFirstAppointment(), ilObject\getId(), and read().

353  {
354  global $ilDB,$ilUser,$ilAppEventHandler;
355 
356  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
357 
358  $this->read();
359 
360  // Copy settings
361  $this->cloneSettings($new_obj);
362 
363  // Clone appointment
364  $new_app = $this->getFirstAppointment()->cloneObject($new_obj->getId());
365  $new_obj->setAppointments(array($new_app));
366  $new_obj->update();
367 
368  // Clone session files
369  foreach($this->files as $file)
370  {
371  $file->cloneFiles($new_obj->getEventId());
372  }
373 
374  // Raise update forn new appointments
375 
376 
377 
378  // Copy learning progress settings
379  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
380  $obj_settings = new ilLPObjSettings($this->getId());
381  $obj_settings->cloneSettings($new_obj->getId());
382  unset($obj_settings);
383 
384  return $new_obj;
385  }
print $file
read()
read session data
getId()
get object id public
global $ilUser
Definition: imgupload.php:15
cloneSettings($new_obj)
clone settings
getFirstAppointment()
get first appointment
+ Here is the call graph for this function:

◆ cloneSettings()

ilObjSession::cloneSettings (   $new_obj)

clone settings

public

Parameters

Definition at line 394 of file class.ilObjSession.php.

References enabledRegistration(), getDetails(), getEmail(), getLocation(), getName(), and getPhone().

Referenced by cloneObject().

395  {
396  $new_obj->setLocation($this->getLocation());
397  $new_obj->setName($this->getName());
398  $new_obj->setPhone($this->getPhone());
399  $new_obj->setEmail($this->getEmail());
400  $new_obj->setDetails($this->getDetails());
401  $new_obj->enableRegistration($this->enabledRegistration());
402  $new_obj->update();
403 
404  return true;
405  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
getPhone()
get phone
getDetails()
get details
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjSession::create ( )

create new session

public

Definition at line 436 of file class.ilObjSession.php.

References $query, $res, enabledRegistration(), getDetails(), getEmail(), ilObject\getId(), getLocation(), getName(), getPhone(), and prepareCalendarAppointments().

437  {
438  global $ilDB;
439  global $ilAppEventHandler;
440 
441  parent::create();
442 
443  $next_id = $ilDB->nextId('event');
444  $query = "INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration) ".
445  "VALUES( ".
446  $ilDB->quote($next_id,'integer').", ".
447  $this->db->quote($this->getId() ,'integer').", ".
448  $this->db->quote($this->getLocation() ,'text').",".
449  $this->db->quote($this->getName() ,'text').", ".
450  $this->db->quote($this->getPhone() ,'text').", ".
451  $this->db->quote($this->getEmail() ,'text').", ".
452  $this->db->quote($this->getDetails() ,'text').",".
453  $this->db->quote($this->enabledRegistration() ,'integer')." ".
454  ")";
455  $res = $ilDB->manipulate($query);
456  $this->event_id = $next_id;
457 
458  $ilAppEventHandler->raise('Modules/Session',
459  'create',
460  array('object' => $this,
461  'obj_id' => $this->getId(),
462  'appointments' => $this->prepareCalendarAppointments('create')));
463 
464  return $this->getId();
465  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getPhone()
get phone
getDetails()
get details
+ Here is the call graph for this function:

◆ delete()

ilObjSession::delete ( )

delete session and all related data

public

Returns
bool

Definition at line 508 of file class.ilObjSession.php.

References $file, $query, $res, ilEventItems\_delete(), ilEventParticipants\_deleteByEvent(), ilSessionAppointment\_deleteBySession(), getFiles(), ilObject\getId(), and prepareCalendarAppointments().

509  {
510  global $ilDB;
511  global $ilAppEventHandler;
512 
513  if(!parent::delete())
514  {
515  return false;
516  }
517  $query = "DELETE FROM event ".
518  "WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
519  $res = $ilDB->manipulate($query);
520 
521  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
523 
524  include_once('./Modules/Session/classes/class.ilEventItems.php');
525  ilEventItems::_delete($this->getId());
526 
527  include_once('./Modules/Session/classes/class.ilEventParticipants.php');
529 
530  foreach($this->getFiles() as $file)
531  {
532  $file->delete();
533  }
534 
535  $ilAppEventHandler->raise('Modules/Session',
536  'delete',
537  array('object' => $this,
538  'obj_id' => $this->getId(),
539  'appointments' => $this->prepareCalendarAppointments('delete')));
540 
541 
542  return true;
543  }
_delete($a_event_id)
print $file
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getFiles()
get files
+ Here is the call graph for this function:

◆ enabledRegistration()

ilObjSession::enabledRegistration ( )

is registration enabled

public

Returns

Definition at line 269 of file class.ilObjSession.php.

References $registration.

Referenced by cloneSettings(), create(), and update().

270  {
271  return (bool) $this->registration;
272  }
+ Here is the caller graph for this function:

◆ enableRegistration()

ilObjSession::enableRegistration (   $a_registration)

enable registration

public

Parameters

Definition at line 258 of file class.ilObjSession.php.

Referenced by read().

259  {
260  $this->registration = (bool) $a_registration;
261  }
+ Here is the caller graph for this function:

◆ getAppointments()

ilObjSession::getAppointments ( )

get appointments

public

Returns
array

Definition at line 280 of file class.ilObjSession.php.

281  {
282  return $this->appointments ? $this->appointments : array();
283  }

◆ getDetails()

ilObjSession::getDetails ( )

get details

public

Returns
string details

Definition at line 246 of file class.ilObjSession.php.

References $details.

Referenced by cloneSettings(), create(), and update().

247  {
248  return $this->details;
249  }
+ Here is the caller graph for this function:

◆ getEmail()

ilObjSession::getEmail ( )

get email

public

Returns
string email

Definition at line 211 of file class.ilObjSession.php.

References $email.

Referenced by cloneSettings(), create(), hasTutorSettings(), and update().

212  {
213  return $this->email;
214  }
+ Here is the caller graph for this function:

◆ getEventId()

ilObjSession::getEventId ( )

sget event id

public

Returns

Definition at line 122 of file class.ilObjSession.php.

References $event_id.

Referenced by initFiles().

123  {
124  return $this->event_id;
125  }
+ Here is the caller graph for this function:

◆ getFiles()

ilObjSession::getFiles ( )

get files

public

Parameters

Definition at line 327 of file class.ilObjSession.php.

Referenced by delete().

328  {
329  return $this->files ? $this->files : array();
330  }
+ Here is the caller graph for this function:

◆ getFirstAppointment()

ilObjSession::getFirstAppointment ( )

get first appointment

public

Returns
object ilSessionAppointment

Definition at line 315 of file class.ilObjSession.php.

Referenced by cloneObject(), getPresentationTitle(), and prepareCalendarAppointments().

316  {
317  return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] = new ilSessionAppointment());
318  }
class ilSessionAppointment
+ Here is the caller graph for this function:

◆ getLocation()

ilObjSession::getLocation ( )

get location

public

Returns
string location

Definition at line 144 of file class.ilObjSession.php.

References $location.

Referenced by cloneSettings(), create(), and update().

145  {
146  return $this->location;
147  }
+ Here is the caller graph for this function:

◆ getName()

ilObjSession::getName ( )

get name

public

Returns
string name

Definition at line 166 of file class.ilObjSession.php.

References $name.

Referenced by cloneSettings(), create(), hasTutorSettings(), and update().

167  {
168  return $this->name;
169  }
+ Here is the caller graph for this function:

◆ getPhone()

ilObjSession::getPhone ( )

get phone

public

Returns
string phone

Definition at line 188 of file class.ilObjSession.php.

References $phone.

Referenced by cloneSettings(), create(), hasTutorSettings(), and update().

189  {
190  return $this->phone;
191  }
+ Here is the caller graph for this function:

◆ getPresentationTitle()

ilObjSession::getPresentationTitle ( )

get title (overwritten from base class)

public

Returns

Definition at line 100 of file class.ilObjSession.php.

References ilDatePresentation\formatDate(), getFirstAppointment(), ilObject\getTitle(), and IL_CAL_UNIX.

101  {
102  $date = new ilDate($this->getFirstAppointment()->getStart()->getUnixTime(),IL_CAL_UNIX);
103  if($this->getTitle())
104  {
105  return ilDatePresentation::formatDate($this->getFirstAppointment()->getStart()).': '.$this->getTitle();
106  }
107  else
108  {
109  return ilDatePresentation::formatDate($date);
110  }
111 
112  }
const IL_CAL_UNIX
Class for single dates.
static formatDate(ilDateTime $date)
Format a date public.
getTitle()
get object title public
getFirstAppointment()
get first appointment
+ Here is the call graph for this function:

◆ hasTutorSettings()

ilObjSession::hasTutorSettings ( )

check if there any tutor settings

public

Definition at line 221 of file class.ilObjSession.php.

References getEmail(), getName(), and getPhone().

222  {
223  return strlen($this->getName()) or
224  strlen($this->getEmail()) or
225  strlen($this->getPhone());
226  }
getEmail()
get email
getPhone()
get phone
+ Here is the call graph for this function:

◆ initAppointments()

ilObjSession::initAppointments ( )
protected

init appointments

protected

Parameters

Definition at line 582 of file class.ilObjSession.php.

References ilSessionAppointment\_readAppointmentsBySession(), and ilObject\getId().

Referenced by read().

583  {
584  // get assigned appointments
585  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
586  $this->appointments = ilSessionAppointment::_readAppointmentsBySession($this->getId());
587  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFiles()

ilObjSession::initFiles ( )

init files

protected

Parameters

Definition at line 596 of file class.ilObjSession.php.

References ilSessionFile\_readFilesByEvent(), and getEventId().

Referenced by read().

597  {
598  include_once('./Modules/Session/classes/class.ilSessionFile.php');
599  $this->files = ilSessionFile::_readFilesByEvent($this->getEventId());
600  }
getEventId()
sget event id
_readFilesByEvent($a_event_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupSession()

static ilObjSession::lookupSession (   $a_obj_id)
static

Get session data.

Parameters
object$a_obj_id
Returns

Definition at line 75 of file class.ilObjSession.php.

References $data, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjSessionListGUI\getProperties().

76  {
77  global $ilDB;
78 
79  $query = "SELECT * FROM event ".
80  "WHERE obj_id = ".$ilDB->quote($a_obj_id);
81  $res = $ilDB->query($query);
82  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
83  {
84  $data['location'] = $row->location ? $row->location : '';
85  $data['details'] = $row->details ? $row->details : '';
86  $data['name'] = $row->tutor_name ? $row->tutor_name : '';
87  $data['email'] = $row->tutor_email ? $row->tutor_email : '';
88  $data['phone'] = $row->tutor_phone ? $row->tutor_phone : '';
89  }
90  return (array) $data;
91  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the caller graph for this function:

◆ prepareCalendarAppointments()

ilObjSession::prepareCalendarAppointments (   $a_mode = 'create')

Prepare calendar appointments.

public

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

Definition at line 610 of file class.ilObjSession.php.

References getFirstAppointment(), ilObject\getLongDescription(), ilObject\getTitle(), and IL_CAL_TRANSLATION_NONE.

Referenced by create(), delete(), and update().

611  {
612  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
613 
614  switch($a_mode)
615  {
616  case 'create':
617  case 'update':
618 
619  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
620  $app->setTranslationType(IL_CAL_TRANSLATION_NONE);
621  $app->setTitle($this->getTitle() ? $this->getTitle() : $this->lng->txt('obj_sess'));
622  $app->setDescription($this->getLongDescription());
623 
624  $sess_app = $this->getFirstAppointment();
625  $app->setFullday($sess_app->isFullday());
626  $app->setStart($sess_app->getStart());
627  $app->setEnd($sess_app->getEnd());
628  $apps[] = $app;
629 
630  return $apps;
631 
632  case 'delete':
633  // Nothing to do: The category and all assigned appointments will be deleted.
634  return array();
635  }
636  }
const IL_CAL_TRANSLATION_NONE
Apointment templates are used for automatic generated apointments.
getTitle()
get object title public
getLongDescription()
get object long description (stored in object_description)
getFirstAppointment()
get first appointment
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjSession::read ( )

read session data

public

Parameters

Definition at line 552 of file class.ilObjSession.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, enableRegistration(), ilObject\getId(), initAppointments(), initFiles(), setDetails(), setEmail(), setLocation(), setName(), and setPhone().

Referenced by cloneObject().

553  {
554  parent::read();
555 
556  $query = "SELECT * FROM event WHERE ".
557  "obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
558  $res = $this->db->query($query);
559 
560  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
561  {
562  $this->setLocation($row->location);
563  $this->setName($row->tutor_name);
564  $this->setPhone($row->tutor_phone);
565  $this->setEmail($row->tutor_email);
566  $this->setDetails($row->details);
567  $this->enableRegistration((bool) $row->registration);
568  $this->event_id = $row->event_id;
569  }
570 
571  $this->initAppointments();
572  $this->initFiles();
573  }
initFiles()
init files
setLocation($a_location)
set location
setPhone($a_phone)
set phone
initAppointments()
init appointments
setName($a_name)
set name
setEmail($a_email)
set email
enableRegistration($a_registration)
enable registration
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getId()
get object id public
setDetails($a_details)
set details
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAppointments()

ilObjSession::setAppointments (   $appointments)

set appointments

public

Parameters
arrayilSessionAppointments
Returns

Definition at line 304 of file class.ilObjSession.php.

References $appointments.

305  {
306  $this->appointments = $appointments;
307  }

◆ setDetails()

ilObjSession::setDetails (   $a_details)

set details

public

Parameters
stringdetails

Definition at line 235 of file class.ilObjSession.php.

Referenced by read().

236  {
237  $this->details = $a_details;
238  }
+ Here is the caller graph for this function:

◆ setEmail()

ilObjSession::setEmail (   $a_email)

set email

public

Parameters
stringemail
Returns

Definition at line 200 of file class.ilObjSession.php.

Referenced by read().

201  {
202  $this->email = $a_email;
203  }
+ Here is the caller graph for this function:

◆ setLocation()

ilObjSession::setLocation (   $a_location)

set location

public

Parameters
stringlocation

Definition at line 133 of file class.ilObjSession.php.

Referenced by read().

134  {
135  $this->location = $a_location;
136  }
+ Here is the caller graph for this function:

◆ setName()

ilObjSession::setName (   $a_name)

set name

public

Parameters
stringname

Definition at line 155 of file class.ilObjSession.php.

Referenced by read().

156  {
157  $this->name = $a_name;
158  }
+ Here is the caller graph for this function:

◆ setPhone()

ilObjSession::setPhone (   $a_phone)

set phone

public

Parameters
stringphone

Definition at line 177 of file class.ilObjSession.php.

Referenced by read().

178  {
179  $this->phone = $a_phone;
180  }
+ Here is the caller graph for this function:

◆ update()

ilObjSession::update ( )

update object

public

Parameters

Definition at line 474 of file class.ilObjSession.php.

References $query, $res, enabledRegistration(), getDetails(), getEmail(), ilObject\getId(), getLocation(), getName(), getPhone(), and prepareCalendarAppointments().

475  {
476  global $ilDB;
477  global $ilAppEventHandler;
478 
479  if(!parent::update())
480  {
481  return false;
482  }
483  $query = "UPDATE event SET ".
484  "location = ".$this->db->quote($this->getLocation() ,'text').",".
485  "tutor_name = ".$this->db->quote($this->getName() ,'text').", ".
486  "tutor_phone = ".$this->db->quote($this->getPhone() ,'text').", ".
487  "tutor_email = ".$this->db->quote($this->getEmail() ,'text').", ".
488  "details = ".$this->db->quote($this->getDetails() ,'text').", ".
489  "registration = ".$this->db->quote($this->enabledRegistration() ,'integer')." ".
490  "WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
491  $res = $ilDB->manipulate($query);
492 
493  $ilAppEventHandler->raise('Modules/Session',
494  'update',
495  array('object' => $this,
496  'obj_id' => $this->getId(),
497  'appointments' => $this->prepareCalendarAppointments('update')));
498 
499  return true;
500  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getPhone()
get phone
getDetails()
get details
+ Here is the call graph for this function:

◆ validate()

ilObjSession::validate ( )

validate

public

Parameters

Definition at line 339 of file class.ilObjSession.php.

340  {
341  return true;
342  }

Field Documentation

◆ $appointments

ilObjSession::$appointments
protected

Definition at line 29 of file class.ilObjSession.php.

Referenced by setAppointments().

◆ $db

ilObjSession::$db
protected

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

◆ $details

ilObjSession::$details
protected

Definition at line 25 of file class.ilObjSession.php.

Referenced by getDetails().

◆ $email

ilObjSession::$email
protected

Definition at line 24 of file class.ilObjSession.php.

Referenced by getEmail().

◆ $event_id

ilObjSession::$event_id
protected

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

Referenced by getEventId().

◆ $files

ilObjSession::$files = array()
protected

Definition at line 30 of file class.ilObjSession.php.

◆ $location

ilObjSession::$location
protected

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

Referenced by getLocation().

◆ $name

ilObjSession::$name
protected

Definition at line 22 of file class.ilObjSession.php.

Referenced by getName().

◆ $phone

ilObjSession::$phone
protected

Definition at line 23 of file class.ilObjSession.php.

Referenced by getPhone().

◆ $registration

ilObjSession::$registration
protected

Definition at line 26 of file class.ilObjSession.php.

Referenced by enabledRegistration().

◆ CAL_REG_START

const ilObjSession::CAL_REG_START = 1

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


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