Event
class Event extends DocumentModel implements SearchableDocumentModelInterface, DoclinkableDocumentModelInterface mixin EventDocumentation
Traits
Constants
EVENT_MODEL_AFTER_SAVE |
|
EVENT_MODEL_BEFORE_SAVE |
|
EVENT_MODEL_BEFORE_DELETE |
|
EVENT_MODEL_AFTER_DELETE |
|
FIELD_IS_NULL |
$this->find_by_field(Model::IS_NULL) |
Properties
EventplannerController | $mod | ||
protected | $model_name | var string Name of this model e.g. category or document |
from Model |
protected | $table_name | ||
$table_use_group_id | |||
protected | $table_auto_properties | ||
protected string | $table_primary_key | from Model | |
protected array | $table_primary_compound_key | from Model | |
protected | $properties | ||
protected array | $properties_meta | from Model | |
protected array | $markers | from Model | |
protected array | $properties_null_values | from Model | |
bool|string | $class_name | from Model | |
string | $render_type | from Model | |
protected int | $model_version | Hint your model version, this parameter might affect certain outcomes and behaviours This version string is added for backwards compatibility |
from Model |
protected | $model_default_render_xui | ||
protected array | $render_params | Parameters that will be consigned to the XUI helper |
from Model |
static string | $find_by_separators | from Model | |
bool | $loaded | from Model | |
bool | $saved | from Model | |
protected array | $changed | from Model | |
array | $cache_function_result | from Model | |
static array | $_request_cache | from Model | |
static protected bool | $auditingDisabled | Is auditing disabled? |
from AuditableTrait |
protected | $auditExcludedProperties | from AuditableTrait | |
static bool | $silent_mode | from DocumentModel | |
protected array | $_update_document_index | from DocumentModel | |
protected DocumentIndex | $documentIndex | from DocumentModel | |
DocumentIndexReference | $rights_context | A document that can be used for accessing this document. Their must either be a reference between the rights_context and the document or the can_read of the document must actually evalute the rights context. |
from DocumentModel |
static | $rights_cache | from DocumentModel | |
protected string[] | $tags |
Methods
Magic Function Object Cloning Make sure object references are cleaned up as each object requires a clean and separate reference
Calls the passed function only if it is not cached yet, otherwise the previous cached result will be returned
Global named scope scopeAll to use on models to return an unscoped unloaded collection
Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope
Called for scope_ Magic Function Creates a new ModelCollection and applies the passed custom scope function
No description
Apply lib->format multi_format on passed property. The result will be written to ->[property]_formatted
Adds a condition to scope the following find functions
Returns whether the related document index should be processed by hooks or not.
builds ical object
Checks if the user can read the event
Returns whether this model should allow related comments or not. The user can still be denied comments when the comments policy "write" is not given to the user.
Checks whether this model can be commented on.
This function checks wether this document can be read by the logged in user and takes the full hierarchy (parent instances) and all possible rights contexts into account
Evaluates can_read_global inside a specific rights context
Checks whether this document can be linked with read reference.
Can see defaults to can_read_global, but can be overridden by supporting modules (e.g. closed group should be visible but not readable)
Returns true if this document can be shared with groups or users.
Checks if the current user is the owner, the organizer or the creator of the event and has therefore edit rights
This function checks wether this document can be read by the logged in user and takes the full hierarchy (parent instances) and all possible rights contexts into account
Evaluates can_write_global inside a specific rights context
Clears the cache for all functions or a specific one
Convert Assoc Multidimensional Array to Model Conditional Array
Returns the count of all models with the specific column value
Creates an HTML email invitation.
Creates job in system_api_mail to handle invitations
creates a vcal string
see also doc of Model->delete().
on the desired collection.
Disables the silent mode Objects in silent mode do not cause document index job queues, thus saving them is much more performant but does not update the search index, the wall or other similar system modules
No description
Sets the silent mode to true Objects in silent mode do not cause document index job queues, thus saving them is much more performant but does not update the search index, the wall or other similar system modules
Find Function to find models using the passed condition
Returns loaded ModelCollection
No description
Returns all models with a specific column value. Query params can be e.g. order_by
No description
Converts a findby* function name to SQL query.
Returns document previews for the attachments with the given label.
Get the (Auditable) properties excluded from audit.
Get the auditable properties to include in audit Defaults to all attributes in the DB Schema
Get the last auditTrail records for current Model
Returns attachments2 and attachment3 if they are images.
Return properties which have been changed after model was initialized/loaded We know these values have been changed locally, but these changes are NOT necessarily reflecting the DB diff
No description
No description
Returns the Query object which is being used for building the query The function creates a new Query object if required to enable lazy loading
Returns the WHERE SQL Conditions based on the current Condition Separate function to be able to update scopes at this point in time if needed
Return properties which have been touched/set after model was initialized/loaded We know these values have been set, but they might not have changed
No description
No description
No description
No description
No description
No description
No description
Returns all properties which are available as DB field (= can be used as find_by() properties) with its currently known raw value Please note that smartTimeFields (updated_at, created_at) are not converted to mysql-date format
No description
returns the detail url for this event
Return the information from the document registry This information contains additional meta data as well as relational information
Returns the path for this documents storage path This folder is automatically cleared when the document is removed
No description
No description
Return the property translated property value if available
True if the deadline has passed.
True if the event has ended.
Returns the SQL table of this model (if available)
No description
No description
No description
No description
Returns if the silent mode is currently active Objects in silent mode do not cause document index job queues, thus saving them is much more performant but does not update the search index, the wall or other similar system modules
No description
Returns a summarized location for this event: Location/City
return the tags for this event
No description
No description
No description
Function is called in routine as part of the index event 'delete' Be aware that the original referenced document will not exist at time of calling This event/callback gives the opportunity to clean up the existing reference (e.g. you are referencing to this document and it you need to act upond this element being deleted)
notifies organizer about participant status change (if organizer_id is set)
No description
Returns whether this document should be present to user (e.g. activity stream/log) after an indexing process or not.
Execute Query of find() function. Can be modified by child class if necessary
Registers the passed scope as default scope A default scope is present when the model is being loaded and can be removed using the unscope() function if required The passed scope must be defined in a scope[SCOPE_NAME] function e.g. scopeGroupId
removes index-entry of this model (only marking to delete).
No description
Loads the rights context by checking all possible rights context and return it without apply on this model.
No description
Provides a list of all values allowed for enumerations.
Returns unloaded ModelCollection
Tells system_api_mail to start sending invites
Set a Property. If $property_id is an array and $property_value is false, set_property is called for each element in the array with the array key and value as params.
Sets parameter that will be passed to the XUI helpers
Sort this element to a specific position
Decrease Sort Priority (Increases SORT value)
Increase Sort Priority (Decreases SORT value)
Temporarily disable the use of the group ID in all queries made
Temporarily enables the use of the group ID in all queries made
Returns an XML of all model properties
TBD: Move this method to the audit model? and keep things slim in trait?
Removes all scopes (including Default Scopes)
updates the related index-item for itself (not global, only for this model!)
Update the sort property for a given table (Move a record up/down)
Details
in
Model at line 994
ModelCollection|Model|Model[]|int
__call(string $method, array $args = array())
No description
in
Model at line 1544
__clone()
Magic Function Object Cloning Make sure object references are cleaned up as each object requires a clean and separate reference
in
Model at line 145
__construct(int|bool $id = false)
No description
in
Model at line 963
mixed
__get(mixed $var)
No description
in
Model at line 1601
__isset($name)
No description
in
Model at line 976
mixed
__set(mixed $var, mixed $value)
No description
in
Model at line 1553
string
__toString()
String Representation of this object (calls for render method)
in
Model at line 1032
mixed
_call_cached_function(string $function, array $args)
Calls the passed function only if it is not cached yet, otherwise the previous cached result will be returned
in
ScopesTrait at line 81
Query
_scopeAll(Query $Query)
Global named scope scopeAll to use on models to return an unscoped unloaded collection
in
ScopesTrait at line 90
Query
_scopeDefault(Query $Query)
Load default scopes
in
ScopesTrait at line 119
protected ModelCollection
_scope_by(mixed $fn, mixed $parameters)
Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope
in
ScopesTrait at line 132
protected ModelCollection
_scope_custom(mixed $fn)
Called for scope_ Magic Function Creates a new ModelCollection and applies the passed custom scope function
in
AuditableTrait at line 97
AuditTrail|null
addAuditTrail(string $event = AuditableInterface::AUDIT_EVENT_MISC, string|null $customMessage = null)
No description
in
Model at line 823
add_formatted_property(string $property, string $format, array $options = array())
Apply lib->format multi_format on passed property. The result will be written to ->[property]_formatted
in
ScopesTrait at line 32
ModelCollection
add_scope_condition(Condition|Query|string $new_condition)
Adds a condition to scope the following find functions
in
Model at line 36
Model[]
all(mixed $params = ['order_by'=>'COL1)
Return all models
in
DocumentModel at line 880
bool
allowIndexProcessingByHooks()
Returns whether the related document index should be processed by hooks or not.
at line 610
string
build_ical_string()
builds ical object
at line 695
bool
can_read()
Checks if the user can read the event
in
DocumentModel at line 392
bool
can_read_comments()
Returns whether this model should allow related comments or not. The user can still be denied comments when the comments policy "write" is not given to the user.
in
DocumentModel at line 404
final bool
can_read_comments_global(bool $return_hidden = false)
Checks whether this model can be commented on.
in
DocumentModel at line 329
final bool
can_read_global($return_hidden = false)
This function checks wether this document can be read by the logged in user and takes the full hierarchy (parent instances) and all possible rights contexts into account
in
DocumentModel at line 376
bool
can_read_global_in_rights_context(DocumentIndexReference|false $rights_context = false)
Evaluates can_read_global inside a specific rights context
in
DocumentModel at line 743
bool
can_reference()
Checks whether this document can be linked with read reference.
This method also considers the group context and parent context of the mod owns this document to apply module specific reference policies.
in
DocumentModel at line 718
bool
can_see()
Can see defaults to can_read_global, but can be overridden by supporting modules (e.g. closed group should be visible but not readable)
in
DocumentModel at line 451
bool
can_share()
Returns true if this document can be shared with groups or users.
This method can be overridden by subclass.
at line 707
bool
can_write()
Checks if the current user is the owner, the organizer or the creator of the event and has therefore edit rights
in
DocumentModel at line 461
final bool
can_write_global($return_hidden = false)
This function checks wether this document can be read by the logged in user and takes the full hierarchy (parent instances) and all possible rights contexts into account
in
DocumentModel at line 494
bool
can_write_global_in_rights_context(DocumentIndexReference $rights_context)
Evaluates can_write_global inside a specific rights context
in
Model at line 1051
clear_cached_functions(string|bool $function = false)
Clears the cache for all functions or a specific one
in
Model at line 567
clear_properties()
No description
in
Model at line 1228
array
convert_array_to_conditions(array $params = array())
Convert Assoc Multidimensional Array to Model Conditional Array
in
Model at line 36
int
count_all()
Returns the count of all models
in
Model at line 36
Model[]
count_by_TABLE_COL_and_TABLE_COL2(mixed $COL1_VALUE, mixed $COL2_VALUE)
Returns the count of all models with the specific column value
at line 419
create_html_mail_job()
Creates an HTML email invitation.
An embedded preview image and attachments are possible. Replies from Apple iCal are processed & the answer is saved in the Eventplanner.
at line 584
create_mail_job()
Creates job in system_api_mail to handle invitations
at line 795
string
create_vcal_request(mixed $inbox, string $method = "REQUEST")
creates a vcal string
in
Model at line 808
string|void
debug(bool $show_markers = false, int $mode = 0)
No description
at line 721
bool
delete()
see also doc of Model->delete().
..
in
Model at line 36
int
delete_by_TABLE_COL(mixed $COL_VALUE) Delete rows specified by condition and returns the affected rows. NOTE: This does not trigger a delete() function of the model. If required use pluck('delete')
on the desired collection.
in
DocumentModel at line 68
void
disable_silent_mode()
Disables the silent mode Objects in silent mode do not cause document index job queues, thus saving them is much more performant but does not update the search index, the wall or other similar system modules
in
Model at line 1497
void
disable_table_group_id()
Disable the use of the group ID in all queries made
at line 85
duplicate()
No description
in
DocumentModel at line 57
void
enable_silent_mode()
Sets the silent mode to true Objects in silent mode do not cause document index job queues, thus saving them is much more performant but does not update the search index, the wall or other similar system modules
in
Model at line 1520
void
enable_table_group_id()
Enable the use of the group ID in all queries made
in
Model at line 1094
mixed
find(string $mode = 'all', mixed $conditions = false, mixed $query_params = false)
Find Function to find models using the passed condition
in
Model at line 36
ModelCollection|Model[]
find_all_by_TABLE_COL_and_TABLE_COL2($COL1_VALUE, $COL2_VALUE, $params=['order_by'=>'COL1, 5]] $)
Returns loaded ModelCollection
at line 36
ModelCollection
find_all_by_id(string|string[] $event_ids, array $query_params = [])
No description
in
Model at line 36
Model
find_by_TABLE_COL(mixed $COL_VALUE, mixed $params = ['order_by'=>'COL1)
Returns all models with a specific column value. Query params can be e.g. order_by
at line 36
Event
find_by_id(mixed $id, mixed $query_params)
No description
in
Model at line 1286
Query
functionNameToQuery(string $query, array $parameters)
Converts a findby* function name to SQL query.
at line 1069
array
getAttachmentPreviews()
Returns document previews for the attachments with the given label.
in
AuditableTrait at line 166
array
getAuditEvents()
Get audit events
in
AuditableTrait at line 220
array
getAuditExcludeProperties()
Get the (Auditable) properties excluded from audit.
Defaults to primary_key and timestamps
in
AuditableTrait at line 199
array
getAuditIncludeProperties()
Get the auditable properties to include in audit Defaults to all attributes in the DB Schema
in
AuditableTrait at line 183
AuditTrail[]|ModelCollection
getAuditTrail(int $limit = 50)
Get the last auditTrail records for current Model
at line 1103
array
getCarouselImages()
Returns attachments2 and attachment3 if they are images.
in
Model at line 1685
array
getChangedProperties(bool $returnOldValues = false)
Return properties which have been changed after model was initialized/loaded We know these values have been changed locally, but these changes are NOT necessarily reflecting the DB diff
in
Model at line 839
ModelCollection
getCollectionByQuery(string $model_name, array|string $dbquery_result, string $population_mode = 'full', string $post_fill_function = 'update')
No description
in
Model at line 187
array
getDBSchema()
Get DB Schema if available
in
DocumentModel at line 46
Controller
getMod()
No description
at line 36
EventCollection
getModelCollection()
No description
in
Model at line 450
array
getPropertyMarkers(bool $value_discovery = true)
Return properties and markers
in
ScopesTrait at line 212
Query
getScopeQuery()
Returns the Query object which is being used for building the query The function creates a new Query object if required to enable lazy loading
in
ScopesTrait at line 202
protected string
getScopeQueryConditionSQL()
Returns the WHERE SQL Conditions based on the current Condition Separate function to be able to update scopes at this point in time if needed
in
Model at line 1666
array
getTouchedProperties(bool $returnOldValues = false)
Return properties which have been touched/set after model was initialized/loaded We know these values have been set, but they might not have changed
at line 168
get_attachment1_url()
No description
at line 133
get_attachment2_label()
No description
at line 201
get_attachment2_link($label = false)
No description
at line 151
get_attachment3_label()
No description
at line 210
get_attachment3_link($label = false)
No description
in
DocumentModel at line 830
DocumentItem
get_cf()
Return the cf library for this model type
in
Model at line 1472
string
get_created_at_formatted()
Return a Formatted DateTime
at line 296
get_current_participant_count()
No description
at line 276
get_custom_id()
No description
in
Model at line 479
array
get_db_properties()
Returns all properties which are available as DB field (= can be used as find_by() properties) with its currently known raw value Please note that smartTimeFields (updated_at, created_at) are not converted to mysql-date format
at line 247
get_description_limited()
No description
at line 1164
string|null
get_detailUrl()
returns the detail url for this event
in
DocumentModel at line 119
DocumentIndex|null
get_document_index()
Returns the related document index.
in
DocumentModel at line 774
DocumentRegistry
get_document_registry_info()
Return the information from the document registry This information contains additional meta data as well as relational information
in
DocumentModel at line 218
get_document_tmp_folder()
Returns the path for this documents storage path This folder is automatically cleared when the document is removed
at line 129
string
get_domain()
deprecated
deprecated
Returns the XELOS Host URL.
at line 257
get_end_formated()
No description
at line 958
get_event_templates()
No description
in
DocumentModel at line 279
null
get_from_rights_cache(DocumentModel $document, string $right)
No description
in
Model at line 1642
bool|mixed
get_i18n_property(string $property, string $force_language = false)
Return the property translated property value if available
at line 81
bool
get_is_deadline_passed()
True if the deadline has passed.
at line 72
bool
get_is_expired()
True if the event has ended.
in
Model at line 317
string
get_model_name()
Returns the SQL table of this model (if available)
in
Model at line 296
string|bool
get_model_table_name(string $table_name = null)
Returns the SQL table of this model (if available)
at line 313
get_participating_participant_count()
No description
at line 1168
string|null
get_participationStatus()
No description
at line 115
get_payment_admin_email()
No description
at line 950
get_payment_options_pop_data()
No description
in
Model at line 430
array
get_properties(bool $value_discovery = true)
Returns the complete properties array
in
Model at line 466
array
get_properties_meta(bool|string $field = false)
No description
in
Model at line 397
mixed
get_property(string $property_id, bool $get_raw_value = false)
No description
in
Model at line 1630
static mixed|null
get_request_cache(string $key)
Return Cache Entry if it exists
in
DocumentModel at line 79
bool
get_silent_mode()
Returns if the silent mode is currently active Objects in silent mode do not cause document index job queues, thus saving them is much more performant but does not update the search index, the wall or other similar system modules
at line 252
get_start_formated()
No description
at line 1119
string
get_summarizedLocation()
Returns a summarized location for this event: Location/City
in
Model at line 287
string
get_table_name()
Returns the table name of this model.
in
Model at line 309
string
get_table_primary_key()
No description
at line 1138
array
get_tags()
return the tags for this event
at line 963
get_title_with_date()
No description
in
Model at line 1481
string
get_updated_at_formatted()
Return a Formatted DateTime
at line 262
get_user_status($user_id = false)
No description
at line 750
get_vcal_attachment($inbox = false, $method = "REQUEST")
No description
in
DocumentModel at line 800
Document
get_xui_document()
Get XUI Document Representation
in
DocumentModel at line 852
void
handle_reference_delete(DocumentIndexReference $reference, int $event_user_id = null)
Function is called in routine as part of the index event 'delete' Be aware that the original referenced document will not exist at time of calling This event/callback gives the opportunity to clean up the existing reference (e.g. you are referencing to this document and it you need to act upond this element being deleted)
Can be implemented in document models
in
Model at line 1696
bool
hasChangedProperties()
No description
in
Model at line 1673
bool
hasTouchedProperties()
No description
in
Model at line 199
init(bool $auto_load = true)
Initializes the model
in
AuditableTrait at line 43
initAuditableTrait()
Init Method
in
AuditableTrait at line 233
bool
isAuditingEnabled()
Determine whether auditing is enabled.
Defaults to true for Frontend/UI Actions and false for CLI/Console Actions
in
Model at line 355
load()
No description
in
Model at line 698
protected bool
load_from_db(string $table_name, array|bool $key_fields = false)
No description
at line 894
bool
notify_organizer(mixed $name, mixed $new_status, mixed $old_status)
notifies organizer about participant status change (if organizer_id is set)
at line 973
SearchIndexRecord
onSearchIndexUpdate(SearchIndexRecord $baseIndexRecord)
No description
in
Model at line 932
ModelCollection|Model[]
populate_model_by_query(string $model_name, array|string $dbquery_result, string $population_mode = 'full', string $post_fill_function = 'update')
deprecated
deprecated
No description
in
DocumentModel at line 890
bool
preventPresentationAfterIndexing()
Returns whether this document should be present to user (e.g. activity stream/log) after an indexing process or not.
in
Model at line 1246
protected array
process_find_query(mixed $select_field, mixed $query_params)
Execute Query of find() function. Can be modified by child class if necessary
in
ScopesTrait at line 105
protected void
registerDefaultScope($scopeName)
Registers the passed scope as default scope A default scope is present when the model is being loaded and can be removed using the unscope() function if required The passed scope must be defined in a scope[SCOPE_NAME] function e.g. scopeGroupId
in
Model at line 160
reload_schema()
Reloads the schema of the model
in
DocumentModel at line 205
final
remove_document_index()
removes index-entry of this model (only marking to delete).
the real delete operation will be triggered by the document_index_deamon. (will be automatically trigged at: DocumentModel->delete())
in
DocumentModel at line 234
protected bool
remove_from_db(string $table_name, array $key_fields = null)
No description
in
DocumentModel at line 789
null
render()
Generic Renderer
at line 388
renderHTMLEmail($subject = false, $text = false)
No description
in
DocumentModel at line 687
mixed|DocumentIndexReference
resolve_rights_context(null|string $right = null, bool $apply = false)
Loads the rights context by checking all possible rights context and return it without apply on this model.
at line 331
int|bool
save()
No description
in
Model at line 584
protected int|bool
save_to_db(string $table_name, array $params = array())
No description
in
Model at line 1266
bool|array
schema_values(mixed $field_name)
Provides a list of all values allowed for enumerations.
Returns FALSE if the field in question does not exist Returns TRUE for non enum fields Returns an array for enum fields with all available values
in
ScopesTrait at line 14
ModelCollection
scopeAll()
No description
in
Model at line 36
Model[]
scope_by_TABLE_COL_and_TABLE_COL2(mixed $COL1_VALUE, mixed $COL2_VALUE)
Returns unloaded ModelCollection
in
Model at line 36
void
self() $this find_by_id($id)
No description
at line 593
send_invites()
Tells system_api_mail to start sending invites
in
DocumentModel at line 132
setDocumentIndex(DocumentIndex $documentIndex)
Sets the related document index.
in
ScopesTrait at line 71
void
setModelCollectionReference(ModelCollection $modelCollectionReference)
No description
in
Model at line 550
void
set_properties_from_array(array $input, array|bool $filter = false)
No description
in
Model at line 499
set_property(string|array $property_id, string|bool $property_value = false, bool $no_change = false)
Set a Property. If $property_id is an array and $property_value is false, set_property is called for each element in the array with the array key and value as params.
in
Model at line 1574
set_render_params(mixed $params = array())
Sets parameter that will be passed to the XUI helpers
in
Model at line 1614
static
set_request_cache(string $key, mixed $value)
Set Request Cache Entry
in
DocumentModel at line 306
null
set_to_rights_cache(DocumentModel $document, string $right, $value)
No description
in
SortTrait at line 116
void
sortMoveTo(int $id, int $sortTo, array|null $conditions = [])
Sort this element to a specific position
in
SortTrait at line 28
sort_down(int $steps = 1, $params = array())
Decrease Sort Priority (Increases SORT value)
in
SortTrait at line 17
sort_up(int $steps = 1, $params = array())
Increase Sort Priority (Decreases SORT value)
in
Model at line 1536
stop_temporary_group_id_overwrite()
Stops the temporary overwrite of the table_group_id
in
Model at line 1511
void
temporarily_disable_table_group_id()
Temporarily disable the use of the group ID in all queries made
in
Model at line 1528
void
temporarily_enable_table_group_id()
Temporarily enables the use of the group ID in all queries made
in
Model at line 1444
string
to_json()
Returns the model as JSON array
in
Model at line 1455
string
to_string()
Returns the model as STRING
in
Model at line 1397
string
to_xml(array|bool $property_filter = false, bool|DOMDocument $doc = false, DOMElement $parent_element = null)
Returns an XML of all model properties
in
AuditableTrait at line 59
triggerAuditEvent(Model $model, string $eventKey = AuditableInterface::OBSERVE_EVENT_SAVE)
TBD: Move this method to the audit model? and keep things slim in trait?
in
ScopesTrait at line 49
ModelCollection
unscope($scopeName = false)
Removes all scopes (including Default Scopes)
in
DocumentModel at line 143
final bool
update_document_index(string $status = IndexEventInterface::EVENT_UPDATE)
updates the related index-item for itself (not global, only for this model!)
in
SortTrait at line 43
protected int
update_sort(mixed $id = false, string $direction = 'up', int $steps = 1, array $params = array())
Update the sort property for a given table (Move a record up/down)
in
Model at line 951
string|true
validate(array $fieldErrors)
No description