Stud.IP  jlu_3.3 Revision
CalendarEvent Class Reference
Inheritance diagram for CalendarEvent:
Inheritance graph
Collaboration diagram for CalendarEvent:
Collaboration graph

Public Member Functions

 __clone ()
 
 toStringCategories ($as_array=false)
 
 getRecurrence ($index=null)
 
 setRecurrence ($r_rule)
 
 toStringRecurrence ($only_type=false)
 
 toStringPriority ()
 
 toStringAccessibility ()
 
 getExceptions ()
 
 setExceptions ($exceptions)
 
 getTitle ()
 
 setTitle ($title)
 
 getStart ()
 
 setStart ($timestamp)
 
 getEnd ()
 
 setEnd ($timestamp)
 
 getAuthorId ()
 
 setAuthorId ($author_id)
 
 setEditorId ($editor_id)
 
 getDuration ()
 
 getLocation ()
 
 getUid ()
 
 getDescription ()
 
 getCategory ()
 
 getUserDefinedCategories ()
 
 setUserDefinedCategories ($categories)
 
 setAccessibility ($class)
 
 setPriority ($priority)
 
 getEditorId ()
 
 isDayEvent ()
 
 getAccessibility ()
 
 getAccessibilityOptions ($permission)
 
 getChangeDate ()
 
 getImportDate ()
 
 getType ()
 
 getPriority ()
 
 getName ()
 
 getProperties ()
 
 getProperty ($name)
 
 setPermissionUser ($user_id)
 
 havePermission ($permission, $user_id=null)
 
 getPermission ($user_id=null)
 
 getAuthor ()
 
 getEditor ()
 
 getAttendees ()
 
- Public Member Functions inherited from SimpleORMap
 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 setData ($data, $reset=false)
 
 haveData ()
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 
- Public Member Functions inherited from Event
 toStringCategories ()
 
 getRecurrence ($index=null)
 
 getType ()
 
 getTitle ()
 
 getStart ()
 
 getEnd ()
 
 getDuration ()
 
 getLocation ()
 
 getUid ()
 
 getDescription ()
 
 getCategory ()
 
 getEditorId ()
 
 isDayEvent ()
 
 getAccessibility ()
 
 getChangeDate ()
 
 getImportDate ()
 
 getProperties ()
 
 getProperty ($name)
 
 havePermission ($permission, $user_id=null)
 
 getPermission ($user_id=null)
 
 toStringPriority ()
 
 toStringAccessibility ()
 
 toStringRecurrence ($only_type=false)
 
 getAuthor ()
 
 getEditor ()
 

Static Public Member Functions

static deleteBySQL ($where, $params=array())
 
static findByUid ($uid, $range_id=null)
 
static getEventsByInterval ($range_id, DateTime $start, DateTime $end)
 
- Static Public Member Functions inherited from SimpleORMap
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=array())
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=array())
 
static findByObject (SimpleORMap $object)
 
static findOneBySQL ($where, $params=array())
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=array())
 
static findMany ($pks=array(), $order='', $order_params=array())
 
static findEachMany ($callable, $pks=array(), $order='', $order_params=array())
 
static findAndMapBySQL ($callable, $where, $params=array())
 
static findAndMapMany ($callable, $pks=array(), $order='', $order_params=array())
 
static deleteBySQL ($where, $params=array())
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 

Static Protected Member Functions

static configure ($config=array())
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=array())
 
static tableScheme ($db_table)
 

Additional Inherited Members

- Data Fields inherited from Event
const PERMISSION_FORBIDDEN = 0
 
const PERMISSION_CONFIDENTIAL = 1
 
const PERMISSION_READABLE = 2
 
const PERMISSION_WRITABLE = 4
 
- Protected Member Functions inherited from SimpleORMap
 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 getTableScheme ()
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 setSerializedValue ($field, $value)
 
- Protected Attributes inherited from SimpleORMap
 $content = array()
 
 $content_db = array()
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = array()
 
 $serialized_fields = array()
 
 $alias_fields = array()
 
 $additional_fields = array()
 
 $relations = array()
 
 $has_many = array()
 
 $has_one = array()
 
 $belongs_to = array()
 
 $has_and_belongs_to_many = array()
 
 $registered_callbacks
 
 $known_slots = array()
 
 $reserved_slots = array('value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id')
 
 $notification_map = array()
 
 $additional_data = array()
 
- Static Protected Attributes inherited from SimpleORMap
static $schemes = null
 
static $config = array()
 

Member Function Documentation

◆ __clone()

__clone ( )

Keeps the event data

Reimplemented from SimpleORMap.

◆ configure()

static configure (   $config = array())
staticprotected

set configuration data from subclass

Parameters
array$configconfiguration data
Returns
void

Reimplemented from SimpleORMap.

◆ deleteBySQL()

static deleteBySQL (   $where,
  $params = array() 
)
static

deletes objects specified by sql clause

Parameters
stringsql clause to use on the right side of WHERE
arrayparameters for query
Returns
number

Reimplemented from SimpleORMap.

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

◆ findByUid()

static findByUid (   $uid,
  $range_id = null 
)
static

Finds calendar events by the uid of the event data.

Parameters
string$uidThe global unique id of this event.
Returns
null|CalendarEvent The calendar event, an array of calendar events or null.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAccessibility()

getAccessibility ( )

Returns the state of accessibility as string. Possible values: PUBLIC, PRIVATE, CONFIDENTIAL The default is CONFIDENTIAL.

Returns
string

Implements Event.

Here is the caller graph for this function:

◆ getAccessibilityOptions()

getAccessibilityOptions (   $permission)

Returns an array with options for accessibility depending on the permission of the given calendar permission.

Parameters
int$permissionThe calendar permission
Returns
array The accessibility options.
Here is the call graph for this function:

◆ getAttendees()

getAttendees ( )

◆ getAuthor()

getAuthor ( )

Returns the author of this event as user object.

Returns
User|null User object.

Implements Event.

◆ getAuthorId()

getAuthorId ( )

Returns the user id of the author.

Returns
string User id of the author.

◆ getCategory()

getCategory ( )

Returns the index of the category. If the user has no permission, 255 is returned.

See also
config/config.inc.php $TERMIN_TYP
Returns
int The index of the category

Implements Event.

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

◆ getChangeDate()

getChangeDate ( )
Returns
type

Implements Event.

◆ getDescription()

getDescription ( )

Returns the description of the topic. If the user has no permission or the event has no topic or the topics have no descritopn an empty string is returned.

Returns
String the description

Implements Event.

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

◆ getDuration()

getDuration ( )

Returns the duration of this event in seconds.

Returns
int the duration of this event in seconds

Implements Event.

◆ getEditor()

getEditor ( )

Returns the editor of this event as user object.

Returns
User|null User object.

Implements Event.

◆ getEditorId()

getEditorId ( )

Returns the user id of the editor.

Returns
string User id of the editor

Implements Event.

◆ getEnd()

getEnd ( )

Returns the endtime as unix timestamp of this event.

Returns
int the endtime of this event as a unix timestamp

Implements Event.

Here is the caller graph for this function:

◆ getEventsByInterval()

static getEventsByInterval (   $range_id,
DateTime  $start,
DateTime  $end 
)
static

Returns all CalendarEvents in the given time range for the given range_id.

Parameters
string$range_idId of Stud.IP object from type user, course, inst
DateTime$startThe start date time.
DateTime$endThe end date time.
Returns
SimpleORMapCollection Collection of found CalendarEvents.
Here is the call graph for this function:

◆ getExceptions()

getExceptions ( )

Returns the exceptions as array of unix timestamps.

Returns
array Array of unix timestamps.

◆ getImportDate()

getImportDate ( )

Returns the date time the event was imported.

TODO not sure if we need this anymore

Returns
int Date time of import as unix timestamp:

Implements Event.

◆ getLocation()

getLocation ( )

Returns the location. Without permission or the location is not set an empty string is returned.

Returns
string The location

Implements Event.

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

◆ getName()

getName ( )

TODO remove! not used?

Returns
type

◆ getPermission()

getPermission (   $user_id = null)

Implements Event.

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

◆ getPriority()

getPriority ( )

Returns the priority: 0 means priority is not stated 1 means "high" 2 means "middle" 3 means "low" If the user has no permission it returns 0.

Returns
int The priority.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProperties()

getProperties ( )

Returns all properties of this event. The name of the properties correspond to the properties of the iCalendar calendar data exchange format. There are a few properties with the suffix STUDIP_ which have no eqivalent in the iCalendar format.

DTSTART: The start date-time as unix timestamp. DTEND: The end date-time as unix timestamp. SUMMARY: The short description (title) that will be displayed in the views. DESCRIPTION: The long description. UID: The global unique id of this event. CLASS: CATEGORIES: A comma separated list of categories. PRIORITY: The priority. LOCATION: The location. EXDATE: A comma separated list of unix timestamps. CREATED: The creation date-time as unix timestamp. LAST-MODIFIED: The date-time of last modification as unix timestamp. DTSTAMP: The cration date-time of this instance of the event as unix timestamp. RRULE: All data for the recurrence rule for this event as array. EVENT_TYPE:

Returns
array The properties of this event.

Implements Event.

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

◆ getProperty()

getProperty (   $name)

Returns the value of property with given name.

Parameters
type$nameSee CalendarEvent::getProperties() for accepted values.
Returns
mixed The value of the property.
Exceptions
InvalidArgumentException

Implements Event.

Here is the call graph for this function:

◆ getRecurrence()

getRecurrence (   $index = null)

Returns all values that defines a recurrence rule or a single value named by $index.

Parameters
string$indexName of the value to retrieve (optional).
Returns
string|array The value(s) of the recurrence rule.
Exceptions
InvalidArgumentException

Implements Event.

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

◆ getStart()

getStart ( )

Returns the starttime as unix timestamp of this event.

Returns
int The starttime of this event as a unix timestamp

Implements Event.

Here is the caller graph for this function:

◆ getTitle()

getTitle ( )

Returns the title of this event. If the user has not the permission Event::PERMISSION_READABLE, the title is "Keine Berechtigung.".

Returns
string

Implements Event.

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

◆ getType()

getType ( )

Returns the object type this event belongs to. Possible values are 'user', 'sem', 'inst', 'fak'.

Returns
string The object type.

Implements Event.

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

◆ getUid()

getUid ( )

Returns the global uni id of this event.

Returns
string The global unique id.

Implements Event.

Here is the caller graph for this function:

◆ getUserDefinedCategories()

getUserDefinedCategories ( )

Returns a csv list of categories. If no categories are stated or the user has no permission an empty string will be returned.

Returns
string csv list of categories or empty string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ havePermission()

havePermission (   $permission,
  $user_id = null 
)

Implements Event.

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

◆ isDayEvent()

isDayEvent ( )

Returns whether this event is an all day event.

Returns
boolean true if all day event

Implements Event.

Here is the call graph for this function:

◆ setAccessibility()

setAccessibility (   $class)

Sets the accessibility (class). Possible classes are 'PUBLIC', 'PRIVATE' and 'CONFIDENTIAL'. If the given class is unknown, the event gets the class 'PRIVATE'.

Parameters
string$classThe name of the class.
Here is the caller graph for this function:

◆ setAuthorId()

setAuthorId (   $author_id)

Sets the author by given user id.

Parameters
string$author_idUser id of the author.

◆ setEditorId()

setEditorId (   $editor_id)

Sets the editor id by given user id.

Parameters
string$editor_idUser id of the editor.

◆ setEnd()

setEnd (   $timestamp)

Sets the end date time by given unix timestamp.

Parameters
string$timestampUnix timestamp.
Here is the caller graph for this function:

◆ setExceptions()

setExceptions (   $exceptions)

Sets proper timestamps as exceptions for given unix timestamps.

Parameters
array$exceptionsArray of exceptions as unix timestamps.
Here is the caller graph for this function:

◆ setPermissionUser()

setPermissionUser (   $user_id)

◆ setPriority()

setPriority (   $priority)

Sets the priority. Possible values are 0: not specified 1: high 2: middle 3: low Default is 0.

Parameters
int$priorityThe priority between 0 and 3.
Here is the caller graph for this function:

◆ setRecurrence()

setRecurrence (   $r_rule)

TODO should throw an exception if input values are wrong

Parameters
array$r_rule
Returns
array The values of the recurrence rule.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStart()

setStart (   $timestamp)

Sets the start date time with given unix timestamp.

Parameters
string$timestampUnix timestamp.
Here is the caller graph for this function:

◆ setTitle()

setTitle (   $title)

Sets the title of this event.

Parameters
type$titleThe title of this event.
Here is the caller graph for this function:

◆ setUserDefinedCategories()

setUserDefinedCategories (   $categories)

Stores user defined categories as a csv list.

Parameters
array | string$categoriesAn array or csv list of user defined categories.
Here is the caller graph for this function:

◆ toStringAccessibility()

toStringAccessibility ( )

Returns the accessibilty in a human readable form. If the user has no permission an epmty string will be returned.

Returns
string The accessibility as string.

Implements Event.

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

◆ toStringCategories()

toStringCategories (   $as_array = false)

Returns a list of all categories the event belongs to. Returns an empty string if no permission.

Returns
string All categories as list.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toStringPriority()

toStringPriority ( )

Returns the priority in a human readable form. If the user has no permission an epmty string will be returned.

Returns
string The priority as a string.

Implements Event.

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

◆ toStringRecurrence()

toStringRecurrence (   $only_type = false)

Returns a string representation of the recurrence rule. If $only_type is true returns only the type of the recurrence.

Parameters
bool$only_typeIf true returns only the type of recurrence.
Returns
string The recurrence rule - human readable

Implements Event.

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

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