ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjSession Class Reference
+ Inheritance diagram for ilObjSession:
+ Collaboration diagram for ilObjSession:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor @access 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...
 
 setRegistrationType ($a_type)
 
 getRegistrationType ()
 
 isRegistrationUserLimitEnabled ()
 
 enableRegistrationUserLimit ($a_limit)
 
 getRegistrationMaxUsers ()
 
 setRegistrationMaxUsers ($a_users)
 
 isRegistrationWaitingListEnabled ()
 
 enableRegistrationWaitingList ($a_stat)
 
 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 (ilObjSession $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 @access 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 @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access 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 @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 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...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. 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) @access public 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 @global 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@access public 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
 
 $reg_type = ilMembershipRegistrationSettings::TYPE_NONE
 
 $reg_limited = 0
 
 $reg_limited_users = 0
 
 $reg_waiting_list = 0
 
 $appointments
 
 $files = array()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

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

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

48 {
49 global $ilDB;
50
51 $this->db = $ilDB;
52 $this->type = "sess";
53 parent::__construct($a_id,$a_call_by_reference);
54 }
global $ilDB

References $ilDB.

Member Function Documentation

◆ _lookupRegistrationEnabled()

static ilObjSession::_lookupRegistrationEnabled (   $a_obj_id)
static

lookup registration enabled

@access public

Parameters

return

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

65 {
66 global $ilDB;
67
68 $query = "SELECT reg_type FROM event ".
69 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
70 $res = $ilDB->query($query);
71 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
72 {
73 return (bool) $row->reg_type != ilMembershipRegistrationSettings::TYPE_NONE;
74 }
75 return false;
76 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilMembershipRegistrationSettings\TYPE_NONE.

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

+ Here is the caller graph for this function:

◆ addAppointment()

ilObjSession::addAppointment (   $appointment)

add appointment

@access public

Parameters
objectilSessionAppointment
Returns

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

331 {
332 $this->appointments[] = $appointment;
333 }

◆ cloneDependencies()

ilObjSession::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone dependencies.

Parameters
inttarget id ref_id of new session
intcopy_id
Returns

Reimplemented from ilObject.

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

459 {
460 global $ilObjDataCache;
461
462 parent::cloneDependencies($a_target_id,$a_copy_id);
463
464 $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
465
466 include_once('./Modules/Session/classes/class.ilEventItems.php');
467 $session_materials = new ilEventItems($target_obj_id);
468 $session_materials->cloneItems($this->getId(),$a_copy_id);
469
470 return true;
471 }
class ilEvent
getId()
get object id @access public

References ilObject\getId().

+ Here is the call graph for this function:

◆ cloneObject()

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

Clone course (no member data)

@access public

Parameters
inttarget ref_id
intcopy id

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

391 {
392 global $ilDB,$ilUser,$ilAppEventHandler;
393
394 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
395
396 $this->read();
397
398 // Copy settings
399 $this->cloneSettings($new_obj);
400
401 // Clone appointment
402 $new_app = $this->getFirstAppointment()->cloneObject($new_obj->getId());
403 $new_obj->setAppointments(array($new_app));
404 $new_obj->update();
405
406 // Clone session files
407 foreach($this->files as $file)
408 {
409 $file->cloneFiles($new_obj->getEventId());
410 }
411
412 // Raise update forn new appointments
413
414
415
416 // Copy learning progress settings
417 include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
418 $obj_settings = new ilLPObjSettings($this->getId());
419 $obj_settings->cloneSettings($new_obj->getId());
420 unset($obj_settings);
421
422 return $new_obj;
423 }
print $file
getFirstAppointment()
get first appointment
read()
read session data
cloneSettings(ilObjSession $new_obj)
clone settings
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

◆ cloneSettings()

ilObjSession::cloneSettings ( ilObjSession  $new_obj)

clone settings

@access public

Parameters
ilObjSession
Returns

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

433 {
434 // @var
435 $new_obj->setLocation($this->getLocation());
436 $new_obj->setName($this->getName());
437 $new_obj->setPhone($this->getPhone());
438 $new_obj->setEmail($this->getEmail());
439 $new_obj->setDetails($this->getDetails());
440
441 $new_obj->setRegistrationType($this->getRegistrationType());
445
446 $new_obj->update();
447
448 return true;
449 }
setLocation($a_location)
set location
setEmail($a_email)
set email
getDetails()
get details
getLocation()
get location
setRegistrationType($a_type)
setName($a_name)
set name
setPhone($a_phone)
set phone
setDetails($a_details)
set details
enableRegistrationUserLimit($a_limit)
enableRegistrationWaitingList($a_stat)
setRegistrationMaxUsers($a_users)
update()
update object

References enableRegistrationUserLimit(), enableRegistrationWaitingList(), getDetails(), getEmail(), getLocation(), getName(), getPhone(), getRegistrationMaxUsers(), getRegistrationType(), isRegistrationUserLimitEnabled(), isRegistrationWaitingListEnabled(), setDetails(), setEmail(), setLocation(), setName(), setPhone(), setRegistrationMaxUsers(), setRegistrationType(), and update().

Referenced by cloneObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjSession::create ( )

create new session

@access public

Reimplemented from ilObject.

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

481 {
482 global $ilDB;
483 global $ilAppEventHandler;
484
485 parent::create();
486
487 $next_id = $ilDB->nextId('event');
488 $query = "INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration, ".
489 'reg_type, reg_limit_users, reg_limited,reg_waiting_list) '.
490 "VALUES( ".
491 $ilDB->quote($next_id,'integer').", ".
492 $this->db->quote($this->getId() ,'integer').", ".
493 $this->db->quote($this->getLocation() ,'text').",".
494 $this->db->quote($this->getName() ,'text').", ".
495 $this->db->quote($this->getPhone() ,'text').", ".
496 $this->db->quote($this->getEmail() ,'text').", ".
497 $this->db->quote($this->getDetails() ,'text').",".
498 $this->db->quote($this->enabledRegistration() ,'integer').", ".
499 $this->db->quote($this->getRegistrationType(),'integer').', '.
500 $this->db->quote($this->getRegistrationMaxUsers(),'integer').', '.
501 $this->db->quote($this->isRegistrationUserLimitEnabled(),'integer').', '.
502 $this->db->quote($this->isRegistrationWaitingListEnabled(),'integer').' '.
503 ")";
504 $res = $ilDB->manipulate($query);
505 $this->event_id = $next_id;
506
507 $ilAppEventHandler->raise('Modules/Session',
508 'create',
509 array('object' => $this,
510 'obj_id' => $this->getId(),
511 'appointments' => $this->prepareCalendarAppointments('create')));
512
513 return $this->getId();
514 }
enabledRegistration()
is registration enabled
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.

References $ilDB, $query, $res, enabledRegistration(), getDetails(), getEmail(), ilObject\getId(), getLocation(), getName(), getPhone(), getRegistrationMaxUsers(), getRegistrationType(), isRegistrationUserLimitEnabled(), isRegistrationWaitingListEnabled(), and prepareCalendarAppointments().

+ Here is the call graph for this function:

◆ delete()

ilObjSession::delete ( )

delete session and all related data

@access public

Returns
bool

Reimplemented from ilObject.

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

561 {
562 global $ilDB;
563 global $ilAppEventHandler;
564
565 if(!parent::delete())
566 {
567 return false;
568 }
569 $query = "DELETE FROM event ".
570 "WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
571 $res = $ilDB->manipulate($query);
572
573 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
575
576 include_once('./Modules/Session/classes/class.ilEventItems.php');
578
579 include_once('./Modules/Session/classes/class.ilEventParticipants.php');
581
582 foreach($this->getFiles() as $file)
583 {
584 $file->delete();
585 }
586
587 $ilAppEventHandler->raise('Modules/Session',
588 'delete',
589 array('object' => $this,
590 'obj_id' => $this->getId(),
591 'appointments' => $this->prepareCalendarAppointments('delete')));
592
593
594 return true;
595 }
_delete($a_event_id)

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

+ Here is the call graph for this function:

◆ enabledRegistration()

ilObjSession::enabledRegistration ( )

is registration enabled

@access public

Returns

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

308 {
309 return $this->reg_type != ilMembershipRegistrationSettings::TYPE_NONE;
310 }

References ilMembershipRegistrationSettings\TYPE_NONE.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ enableRegistrationUserLimit()

ilObjSession::enableRegistrationUserLimit (   $a_limit)

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

275 {
276 $this->reg_limited = $a_limit;
277 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ enableRegistrationWaitingList()

ilObjSession::enableRegistrationWaitingList (   $a_stat)

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

295 {
296 $this->reg_waiting_list = $a_stat;
297 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ getAppointments()

ilObjSession::getAppointments ( )

get appointments

@access public

Returns
array

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

319 {
320 return $this->appointments ? $this->appointments : array();
321 }

◆ getDetails()

ilObjSession::getDetails ( )

get details

@access public

Returns
string details

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

255 {
256 return $this->details;
257 }

References $details.

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

+ Here is the caller graph for this function:

◆ getEmail()

ilObjSession::getEmail ( )

get email

@access public

Returns
string email

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

220 {
221 return $this->email;
222 }

References $email.

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

+ Here is the caller graph for this function:

◆ getEventId()

ilObjSession::getEventId ( )

sget event id

@access public

Returns

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

131 {
132 return $this->event_id;
133 }

References $event_id.

Referenced by initFiles().

+ Here is the caller graph for this function:

◆ getFiles()

ilObjSession::getFiles ( )

get files

@access public

Parameters

return

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

366 {
367 return $this->files ? $this->files : array();
368 }

Referenced by delete().

+ Here is the caller graph for this function:

◆ getFirstAppointment()

ilObjSession::getFirstAppointment ( )

get first appointment

@access public

Returns
object ilSessionAppointment

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

354 {
355 return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] = new ilSessionAppointment());
356 }
class ilSessionAppointment

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

+ Here is the caller graph for this function:

◆ getLocation()

ilObjSession::getLocation ( )

get location

@access public

Returns
string location

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

153 {
154 return $this->location;
155 }

References $location.

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

+ Here is the caller graph for this function:

◆ getName()

ilObjSession::getName ( )

get name

@access public

Returns
string name

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

175 {
176 return $this->name;
177 }

References $name.

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

+ Here is the caller graph for this function:

◆ getPhone()

ilObjSession::getPhone ( )

get phone

@access public

Returns
string phone

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

197 {
198 return $this->phone;
199 }

References $phone.

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

+ Here is the caller graph for this function:

◆ getPresentationTitle()

ilObjSession::getPresentationTitle ( )

get title (overwritten from base class)

@access public

Returns

Reimplemented from ilObject.

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

109 {
110 $date = new ilDate($this->getFirstAppointment()->getStart()->getUnixTime(),IL_CAL_UNIX);
111 if($this->getTitle())
112 {
113 return ilDatePresentation::formatDate($this->getFirstAppointment()->getStart()).': '.$this->getTitle();
114 }
115 else
116 {
117 return ilDatePresentation::formatDate($date);
118 }
119
120 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date)
Format a date @access public.
Class for single dates.
getTitle()
get object title @access public

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

+ Here is the call graph for this function:

◆ getRegistrationMaxUsers()

ilObjSession::getRegistrationMaxUsers ( )

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

280 {
282 }

References $reg_limited_users.

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

+ Here is the caller graph for this function:

◆ getRegistrationType()

ilObjSession::getRegistrationType ( )

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

265 {
266 return $this->reg_type;
267 }

References $reg_type.

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

+ Here is the caller graph for this function:

◆ hasTutorSettings()

ilObjSession::hasTutorSettings ( )

check if there any tutor settings

@access public

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

230 {
231 return strlen($this->getName()) or
232 strlen($this->getEmail()) or
233 strlen($this->getPhone());
234 }

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

+ Here is the call graph for this function:

◆ initAppointments()

ilObjSession::initAppointments ( )
protected

init appointments

@access protected

Parameters

return

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

638 {
639 // get assigned appointments
640 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
641 $this->appointments = ilSessionAppointment::_readAppointmentsBySession($this->getId());
642 }

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

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFiles()

ilObjSession::initFiles ( )

init files

@access protected

Parameters

return

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

652 {
653 include_once('./Modules/Session/classes/class.ilSessionFile.php');
654 $this->files = ilSessionFile::_readFilesByEvent($this->getEventId());
655 }
getEventId()
sget event id
_readFilesByEvent($a_event_id)

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

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUserLimitEnabled()

ilObjSession::isRegistrationUserLimitEnabled ( )

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

270 {
271 return $this->reg_limited;
272 }

References $reg_limited.

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

+ Here is the caller graph for this function:

◆ isRegistrationWaitingListEnabled()

ilObjSession::isRegistrationWaitingListEnabled ( )

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

290 {
292 }

References $reg_waiting_list.

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

+ 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 83 of file class.ilObjSession.php.

84 {
85 global $ilDB;
86
87 $query = "SELECT * FROM event ".
88 "WHERE obj_id = ".$ilDB->quote($a_obj_id);
89 $res = $ilDB->query($query);
90 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
91 {
92 $data['location'] = $row->location ? $row->location : '';
93 $data['details'] = $row->details ? $row->details : '';
94 $data['name'] = $row->tutor_name ? $row->tutor_name : '';
95 $data['email'] = $row->tutor_email ? $row->tutor_email : '';
96 $data['phone'] = $row->tutor_phone ? $row->tutor_phone : '';
97 }
98 return (array) $data;
99 }

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

Referenced by ilObjSessionListGUI\getProperties().

+ Here is the caller graph for this function:

◆ prepareCalendarAppointments()

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

Prepare calendar appointments.

@access public

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

666 {
667 include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
668
669 switch($a_mode)
670 {
671 case 'create':
672 case 'update':
673
674 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
675 $app->setTranslationType(IL_CAL_TRANSLATION_NONE);
676 $app->setTitle($this->getTitle() ? $this->getTitle() : $this->lng->txt('obj_sess'));
677 $app->setDescription($this->getLongDescription());
678
679 $sess_app = $this->getFirstAppointment();
680 $app->setFullday($sess_app->isFullday());
681 $app->setStart($sess_app->getStart());
682 $app->setEnd($sess_app->getEnd());
683 $apps[] = $app;
684
685 return $apps;
686
687 case 'delete':
688 // Nothing to do: The category and all assigned appointments will be deleted.
689 return array();
690 }
691 }
const IL_CAL_TRANSLATION_NONE
Apointment templates are used for automatic generated apointments.
getLongDescription()
get object long description (stored in object_description)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjSession::read ( )

read session data

@access public

Parameters

return

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

605 {
606 parent::read();
607
608 $query = "SELECT * FROM event WHERE ".
609 "obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
610 $res = $this->db->query($query);
611
612 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
613 {
614 $this->setLocation($row->location);
615 $this->setName($row->tutor_name);
616 $this->setPhone($row->tutor_phone);
617 $this->setEmail($row->tutor_email);
618 $this->setDetails($row->details);
619 $this->setRegistrationType($row->reg_type);
620 $this->enableRegistrationUserLimit($row->reg_limited);
621 $this->enableRegistrationWaitingList($row->reg_waiting_list);
622 $this->setRegistrationMaxUsers($row->reg_limit_users);
623 $this->event_id = $row->event_id;
624 }
625
626 $this->initAppointments();
627 $this->initFiles();
628 }
initAppointments()
init appointments
initFiles()
init files

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

Referenced by cloneObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAppointments()

ilObjSession::setAppointments (   $appointments)

set appointments

@access public

Parameters
arrayilSessionAppointments
Returns

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

343 {
344 $this->appointments = $appointments;
345 }

References $appointments.

◆ setDetails()

ilObjSession::setDetails (   $a_details)

set details

@access public

Parameters
stringdetails

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

244 {
245 $this->details = $a_details;
246 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ setEmail()

ilObjSession::setEmail (   $a_email)

set email

@access public

Parameters
stringemail
Returns

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

209 {
210 $this->email = $a_email;
211 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ setLocation()

ilObjSession::setLocation (   $a_location)

set location

@access public

Parameters
stringlocation

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

142 {
143 $this->location = $a_location;
144 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ setName()

ilObjSession::setName (   $a_name)

set name

@access public

Parameters
stringname

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

164 {
165 $this->name = $a_name;
166 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ setPhone()

ilObjSession::setPhone (   $a_phone)

set phone

@access public

Parameters
stringphone

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

186 {
187 $this->phone = $a_phone;
188 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ setRegistrationMaxUsers()

ilObjSession::setRegistrationMaxUsers (   $a_users)

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

285 {
286 $this->reg_limited_users = $a_users;
287 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ setRegistrationType()

ilObjSession::setRegistrationType (   $a_type)

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

260 {
261 $this->reg_type = $a_type;
262 }

Referenced by cloneSettings(), and read().

+ Here is the caller graph for this function:

◆ update()

ilObjSession::update ( )

update object

@access public

Parameters

return bool success

Reimplemented from ilObject.

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

524 {
525 global $ilDB;
526 global $ilAppEventHandler;
527
528 if(!parent::update())
529 {
530 return false;
531 }
532 $query = "UPDATE event SET ".
533 "location = ".$this->db->quote($this->getLocation() ,'text').",".
534 "tutor_name = ".$this->db->quote($this->getName() ,'text').", ".
535 "tutor_phone = ".$this->db->quote($this->getPhone() ,'text').", ".
536 "tutor_email = ".$this->db->quote($this->getEmail() ,'text').", ".
537 "details = ".$this->db->quote($this->getDetails() ,'text').", ".
538 "registration = ".$this->db->quote($this->enabledRegistration() ,'integer').", ".
539 "reg_type = ".$this->db->quote($this->getRegistrationType() ,'integer').", ".
540 "reg_limited = ".$this->db->quote($this->isRegistrationUserLimitEnabled() ,'integer').", ".
541 "reg_limit_users = ".$this->db->quote($this->getRegistrationMaxUsers() ,'integer').", ".
542 "reg_waiting_list = ".$this->db->quote($this->isRegistrationWaitingListEnabled(),'integer')." ".
543 "WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
544 $res = $ilDB->manipulate($query);
545
546 $ilAppEventHandler->raise('Modules/Session',
547 'update',
548 array('object' => $this,
549 'obj_id' => $this->getId(),
550 'appointments' => $this->prepareCalendarAppointments('update')));
551 return true;
552 }

References $ilDB, $query, $res, enabledRegistration(), getDetails(), getEmail(), ilObject\getId(), getLocation(), getName(), getPhone(), getRegistrationMaxUsers(), getRegistrationType(), isRegistrationUserLimitEnabled(), isRegistrationWaitingListEnabled(), and prepareCalendarAppointments().

Referenced by cloneSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjSession::validate ( )

validate

@access public

Parameters

return bool

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

378 {
379 return true;
380 }

Field Documentation

◆ $appointments

ilObjSession::$appointments
protected

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

Referenced by setAppointments().

◆ $db

ilObjSession::$db
protected

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

◆ $details

ilObjSession::$details
protected

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

Referenced by getDetails().

◆ $email

ilObjSession::$email
protected

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

Referenced by getEmail().

◆ $event_id

ilObjSession::$event_id
protected

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

Referenced by getEventId().

◆ $files

ilObjSession::$files = array()
protected

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

◆ $location

ilObjSession::$location
protected

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

Referenced by getLocation().

◆ $name

ilObjSession::$name
protected

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

Referenced by getName().

◆ $phone

ilObjSession::$phone
protected

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

Referenced by getPhone().

◆ $reg_limited

ilObjSession::$reg_limited = 0
protected

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

Referenced by isRegistrationUserLimitEnabled().

◆ $reg_limited_users

ilObjSession::$reg_limited_users = 0
protected

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

Referenced by getRegistrationMaxUsers().

◆ $reg_type

ilObjSession::$reg_type = ilMembershipRegistrationSettings::TYPE_NONE
protected

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

Referenced by getRegistrationType().

◆ $reg_waiting_list

ilObjSession::$reg_waiting_list = 0
protected

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

Referenced by isRegistrationWaitingListEnabled().

◆ $registration

ilObjSession::$registration
protected

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

◆ CAL_REG_START

const ilObjSession::CAL_REG_START = 1

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


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