Document
class Document extends Document
Class Document
Traits
Trait DuplicatableModelTrait
Trait Auditable to be used in Models
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
| Controller read-only | $mod | from AuditableTrait | |
| protected string|null | $model_name | from Model | |
| string read-only | $table_name | from AuditableTrait | |
| protected bool | $table_use_group_id | from Document | |
| protected bool | $table_auto_properties | from Document | |
| protected string | $table_primary_key | from Model | |
| protected array | $table_primary_compound_key | from Model | |
| array read-only | $properties | from AuditableTrait | |
| protected array | $properties_meta | from Model | |
| protected array | $markers | 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 string | $model_default_render_xui | from Document | |
| 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|null | $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 |
| protected bool | $save_as_new_version | from Document | |
| protected string | $attach_new_file | from Document | |
| protected bool | $action_logged | from Document | |
| DocumentIndex | $reference_document_index | from Document | |
| DocumentModel|Document | $reference_document | from Document | |
| DocumentIndexReference | $reference_object | from Document | |
| bool|int | $current_category_id | from Document | |
| bool | $_load | from Document | |
| array | $action_links | Set with XELOS\Modules\SystemDMS\Model\xm_system_dms_document::attach_document_actions |
from Document |
| string | $file_extension | Accessible via XELOS\Modules\SystemDMS\Model\xm_system_dms_document::get_file_extension |
from Document |
| string | $file_path | Accessible via XELOS\Modules\SystemDMS\Model\xm_system_dms_document::get_file_path |
from Document |
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
Attach action Links for a document Links that would be set on field 'action_links' as array
- lock
- delete (only if policy matches)
- edit (only if policy matches)
- detail
- download
No description
Returns if current User can delete this Document
Checks if current User can read this Document
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)
Checks if current User can write this Document
Returns whether this model should allow to create comments or not. The user can still be denied to write comments when the comments policy "write" is not given to the user.
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
Returns the count of all models with the specific column value
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
Duplicate Model and associated content This function will replicate the current model and its associated content:
- Referenced Documents will be referenced by passive or read reference
- Tags will be copied
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
Get Document by using the uuid
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.
No description
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
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
Returns a list of all property name variants for all languages, e.g. "title_i18n" -> "title_i18n, title_DE_DE, title_EN_EN"
Gets an I18nToken for a model property (e.g. title_i18n)
No description
Centralized function to collect all necessary information to allow the frontend to display the content
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
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
Helper Function to iterate over existing field values to ensure a valid name. a "_ID" with an increasing ID will be appended if the value already exists
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
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
Returns all document objects of the passed category
Returns all document objects with the passed tag
Return a download link to the corresponding file
Get File Download URL
Returns the time the file was last modified. The time is returned as a Unix timestamp, which is suitable for the date() function.
Check for the current FileName without Extension
If a template is used for this document, the values are formatted.
Returns a list with all versioned document objects
Return the property translated property value if available
Returns the SQL table of this model (if available)
Generates the preview pages and returns them
Returns an url with a resized preview (not cropped) If you need a cropped image use get_thumb_url() instead
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
Returns an url to the thumb of this document if available The thumb is cropped to the passed dimensions. If you need an uncropped version please use get_preview_url
Does this model represent an existing database record? (can be updated)
Should reference items be duplicated (deep copy of dms objects) If false (default), references will be replicated as shallow read references to their original items
Checks if the mime type of this document matches the given mime type.
Checks if the current document has a NAME-duplicate in its Category (Important for webDav-Listing) A Duplicate must have the same File-Extension, too.
Loads the reference document and saves internally as property.
Returns the meta data for this document Wrapped in a public method to allow forwarding that request to link targets in the future
Checks if the mime type of this document matches one of the given mime types.
Automatically recover document index if document model is restored
Function to parse a property which is supposed to contain id references
No description
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).
Rename Filename Do not currently update the file_path
Resolve Combined IDs to a single document
Loads the rights context by checking all possible rights context and return it without apply on this model.
Save document to database
Writes the meta data to the database Wrapped in a public method to allow forwarding this request to link targets in the future
Provides a list of all values allowed for enumerations.
No description
Returns unloaded ModelCollection
Sets a custom thumbnail for this document. Set to FALSE to unset.
Sets the related document index.
Will set the filename url-friendly and without any path-information IMPORTANT: do not use the current model-set-methods it will not rename the files proper
No description
Sets parameter that will be passed to the XUI helpers
Handler for uploading files (should be attached as upload_callback to the corresponding form)
Sort this element to a specific position
Decrease Sort Priority (Increases SORT value)
Increase Sort Priority (Decreases SORT value)
Starts a new version (will be saved when save() is called)
Temporarily disable 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?
Returns an unscoped Collection
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 1117
ModelCollection|Model|Model[]|int
__call(string $method, array $args = array())
No description
in
Model at line 1684
__clone()
Magic Function Object Cloning Make sure object references are cleaned up as each object requires a clean and separate reference
in
Document at line 110
__construct(int|bool $id = false, int|bool $version_id = false)
Constructor
in
Model at line 1093
mixed
__get(mixed $var)
No description
in
Model at line 1743
__isset($name)
No description
in
Model at line 1695
string
__toString()
String Representation of this object (calls for render method)
in
Model at line 1155
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 100
Query
_scopeAll(Query $Query)
Global named scope scopeAll to use on models to return an unscoped unloaded collection
in
ScopesTrait at line 111
Query
_scopeDefault(Query $Query)
Load default scopes
in
ScopesTrait at line 143
protected ModelCollection
_scope_by(string $fn, array $parameters)
Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope
in
ScopesTrait at line 159
protected ModelCollection
_scope_custom(string $scopeName, Query|null $Query = null)
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 954
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 34
ModelCollection
add_scope_condition(Condition|ConditionGroup|Query|string $new_condition)
Adds a condition to scope the following find functions
in
Model at line 40
Model[]
all(mixed $params = ['order_by'=>'COL1)
Return all models
in
Document at line 1663
?array
attach_document_actions(Core|null $mod = null, string $display = 'link', bool $returnLinks = false)
Attach action Links for a document Links that would be set on field 'action_links' as array
- lock
- delete (only if policy matches)
- edit (only if policy matches)
- detail
- download
in
Document at line 809
bool
attach_file(string $fs_path, bool $move = false, string $target_filename = null)
No description
in
Document at line 1436
bool
can_delete(int $category_id = null)
Returns if current User can delete this Document
in
Document at line 1368
bool
can_read(int $category_id = null, bool $return_system_folders = false)
Checks if current User can read this Document
in
DocumentModel at line 429
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 451
final bool
can_read_comments_global(bool $return_hidden = false)
Checks whether this model can be commented on.
in
DocumentModel at line 361
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 413
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 795
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 770
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 498
bool
can_share()
deprecated
deprecated
Returns true if this document can be shared with groups or users.
This method can be overridden by subclass.
in
Document at line 1393
bool
can_write(int $category_id = null)
Checks if current User can write this Document
in
DocumentModel at line 439
bool
can_write_comments()
Returns whether this model should allow to create comments or not. The user can still be denied to write comments when the comments policy "write" is not given to the user.
in
DocumentModel at line 508
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 546
bool
can_write_global_in_rights_context(DocumentIndexReference $rights_context)
Evaluates can_write_global inside a specific rights context
in
Model at line 1174
clear_cached_functions(string|bool $function = false)
Clears the cache for all functions or a specific one
in
Model at line 616
clear_properties()
No description
in
Model at line 40
int
count_all() $eturns the count of all models, see $this->find('count')
No description
in
Model at line 40
int
count_by_TABLE_COL_and_TABLE_COL2(mixed $COL1_VALUE, mixed $COL2_VALUE)
Returns the count of all models with the specific column value
in
Model at line 939
string|void
debug(bool $show_markers = false, int $mode = 0)
No description
in
Document at line 454
bool
delete(bool $trash = true)
Delete Document
in
Model at line 40
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 71
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 1642
void
disable_table_group_id()
Disable the use of the group ID in all queries made
in
DuplicatableModelTrait at line 33
Model
duplicate(array $overwriteProperties = [], DuplicatableInterface|null $targetModel = null)
Duplicate Model and associated content This function will replicate the current model and its associated content:
- Referenced Documents will be referenced by passive or read reference
- Tags will be copied
in
DocumentModel at line 60
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 1667
void
enable_table_group_id()
Enable the use of the group ID in all queries made
in
DocumentModel at line 125
static DocumentModel|null
fetchByUuid(string $uuid, bool $ignoreCanReadRights = false)
deprecated
deprecated
Get Document by using the uuid
in
Model at line 1218
ModelCollection|Model|int|null
find(string $mode = 'all', Condition|ConditionGroup|Query|string|array $conditions = false, array|null $query_params = null)
Find Function to find models using the passed condition
in
Model at line 40
ModelCollection|Model[]
find_all_by_TABLE_COL_and_TABLE_COL2($COL1_VALUE, $COL2_VALUE, $params=['order_by'=>'COL1, 5]] $)
Returns loaded ModelCollection
in
Document at line 48
Document[]
find_all_by_category_id(array $available_category_ids, array $array)
No description
in
Model at line 40
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
in
Document at line 48
Document
find_by_id_and_category_id(mixed $document_id, int $id)
No description
in
Document at line 48
Document|bool
find_by_id_and_group_id(mixed $id, mixed $group_id, mixed $query_params)
No description
in
Model at line 1402
protected Query
functionNameToQuery(string $query, array $parameters)
Converts a findby* function name to SQL query.
in
Document at line 1459
string
generate_file_path(mixed $version = 'current', bool|string $overwrite_filename = false, bool $old_revision_fallback = false)
No description
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
in
Document at line 2412
string
getBasePath()
No description
in
Model at line 1857
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 970
ModelCollection
getCollectionByQuery(string $model_name, array|string $dbquery_result, string $population_mode = 'full', string $post_fill_function = 'update')
No description
in
Model at line 191
array
getDBSchema(string $field = null)
Get DB Schema if available
in
Model at line 1806
string[]
getI18nPropertyVariants($propertyName, $localeAsKey = false)
Returns a list of all property name variants for all languages, e.g. "title_i18n" -> "title_i18n, title_DE_DE, title_EN_EN"
in
Model at line 1914
I18nTokenHelper
getI18nTokenForProperty(string $i18nProperty, int|null $limitString = null)
Gets an I18nToken for a model property (e.g. title_i18n)
in
DocumentModel at line 49
Controller
getMod()
No description
in
Document at line 48
DocumentCollection
getModelCollection()
No description
in
DuplicatableModelTrait at line 190
array
getNonDuplicatableFields(array $ignoredFieldsByDefault = [])
No description
in
Document at line 2118
Preview|null
getPreview(string $type)
No description
in
Document at line 2097
array
getPreviewFiles()
Get Preview Files if available for this document
in
Document at line 2508
array|void
getPreviewInfo($fullInfo = false)
Centralized function to collect all necessary information to allow the frontend to display the content
in
Document at line 2419
string
getPreviewStoragePath()
No description
in
Document at line 2130
ModelCollection
getPreviews()
No description
in
Model at line 334
int|null
getPrimaryKeyValue()
Get the primary id (post_id) for this model
in
Model at line 492
array
getPropertyMarkers(bool $value_discovery = true)
Return properties and markers
in
Document at line 2289
DocumentModel|null
getReferenceDocument()
No description
in
Document at line 2297
DocumentIndex|null
getReferenceDocumentIndex()
No description
in
ScopesTrait at line 217
Query
getScopeQuery(bool $applyDefaultScopes = true)
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
Model at line 1827
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
in
DuplicatableModelTrait at line 112
mixed|string
getUniquePropertyValue($propertyId, $propertyValue)
Helper Function to iterate over existing field values to ensure a valid name. a "_ID" with an increasing ID will be appended if the value already exists
in
Document at line 889
string
get_author()
Returns the author name of the current document
in
DocumentModel at line 882
DocumentItem
get_cf()
Return the cf library for this model type
in
Model at line 1611
string
get_created_at_formatted()
Return a Formatted DateTime
in
Model at line 520
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
in
DocumentModel at line 135
DocumentIndex|null
get_document_index()
Returns the related document index.
in
DocumentModel at line 826
DocumentRegistry|null
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 243
get_document_tmp_folder()
Returns the path for this documents storage path This folder is automatically cleared when the document is removed
in
Document at line 1055
Document[]|ModelCollection
get_documents_by_category(int $category, bool $return_objects = true, bool|string $filter = false, bool $hasSecurityCheck = true)
Returns all document objects of the passed category
in
Document at line 1128
array
get_documents_by_search(int $query, bool $return_objects = true, array $search_params = [], int $limit = 200)
Returns all document objects with the passed tag
in
Document at line 1006
string
get_download_link(int $limit = 25, bool $icon = true)
No description
in
Document at line 993
string
get_download_link_full(bool $icon = true)
Return a download link to the corresponding file
in
Document at line 1020
bool|string
get_download_url()
No description
in
Document at line 1527
string
get_file_base_path(bool $force_this = false)
No description
in
Document at line 855
string
get_file_extension()
Check for the current File-Extension
in
Document at line 1547
string
get_file_path()
Returns the file path of this or the reference document.
in
Document at line 1502
string
get_file_path_relative(string $version = 'current')
No description
in
Document at line 1874
bool|string
get_file_url(mixed $version = null, bool $inline_disposition = true, $width = null, $height = null)
Get File Download URL
in
Document at line 920
int
get_filemtime()
Returns the time the file was last modified. The time is returned as a Unix timestamp, which is suitable for the date() function.
in
Document at line 872
string
get_filename_url()
gets the url-friendly filename
in
Document at line 838
string
get_filename_without_extension()
Check for the current FileName without Extension
in
Document at line 901
int
get_filesize()
gets the filesize in Bytes for the current file
in
Document at line 941
array
get_formatted_data(bool $xoi_dialog = false)
If a template is used for this document, the values are formatted.
in
Document at line 1203
Document[]|int[]
get_history(bool $return_objects = true, int $limit = null)
Returns a list with all versioned document objects
in
Model at line 1784
bool|mixed
get_i18n_property(string $property, string $force_language = false)
Return the property translated property value if available
in
Document at line 2305
string
get_icon_class()
No description
in
Document at line 177
int
get_latest_version_id()
No description
in
Document at line 1920
xm_webdav_lock|bool
get_lock()
Get the lock of the referenced document
in
Model at line 351
string|null
get_model_name()
Returns the SQL table of this model (if available)
in
Model at line 312
string|bool
get_model_table_name(string $table_name = null)
Returns the SQL table of this model (if available)
in
Document at line 2147
array|false
get_preview_pages(mixed $page_count, bool $force_new = false, bool $cache_only = true)
Generates the preview pages and returns them
in
Document at line 2089
string
get_preview_url($width = 1024, $height = 800)
Returns an url with a resized preview (not cropped) If you need a cropped image use get_thumb_url() instead
in
Model at line 474
array
get_properties(bool $value_discovery = true)
Returns the complete properties array
in
Model at line 508
array
get_properties_meta(?string $field = null)
No description
in
Model at line 434
mixed
get_property(string|null $property_id, bool $get_raw_value = false)
No description
in
Model at line 1772
static mixed|null
get_request_cache(string $key)
Return Cache Entry if it exists
in
DocumentModel at line 82
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
in
Model at line 303
string|null
get_table_name()
Returns the table name of this model.
in
Model at line 325
string|null
get_table_primary_key()
No description
in
Document at line 2069
string
get_thumb_url(int $width = 100, int $height = 100)
Returns an url to the thumb of this document if available The thumb is cropped to the passed dimensions. If you need an uncropped version please use get_preview_url
in
Document at line 2077
string
get_thumb_url_if_set()
No description
in
Document at line 2207
string|int
get_thumbnail_document(bool $force_new = false)
No description
in
Model at line 1620
string
get_updated_at_formatted()
Return a Formatted DateTime
in
Document at line 2330
string
get_version_download_url(int $version_id)
No description
in
Document at line 2340
mixed|string
get_version_string()
No description
in
Document at line 1611
string|null
get_webdav_url()
No description
in
DocumentModel at line 852
Document|null
get_xui_document()
Get XUI Document Representation
in
Document at line 249
void
handle_reference_delete(DocumentIndexReference $reference, $user_id = null)
No description
in
Model at line 1868
bool
hasChangedProperties()
No description
in
Model at line 807
bool
hasExistingDatabaseRecord()
Does this model represent an existing database record? (can be updated)
in
Model at line 1835
bool
hasTouchedProperties()
Returns true if at least one property is marked as changed
in
Document at line 129
init(bool $auto_load = true)
Initialization
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
Document at line 2427
isImage()
No description
in
Document at line 2435
bool
isPreviewReady($progress)
Checks if the previews are already available
in
DuplicatableModelTrait at line 199
protected bool
isReferenceDuplicationAllowed()
Should reference items be duplicated (deep copy of dms objects) If false (default), references will be replicated as shallow read references to their original items
in
Document at line 2423
isVideo()
No description
in
Document at line 1906
bool
is_locked()
Check if referenced document is locked
in
Document at line 1599
bool
is_mime_type($type)
Checks if the mime type of this document matches the given mime type.
in
Document at line 1330
bool
is_name_in_category()
Checks if the current document has a NAME-duplicate in its Category (Important for webDav-Listing) A Duplicate must have the same File-Extension, too.
in
Document at line 185
load()
Loads the document.
in
Document at line 2272
protected void
loadReferenceDocument()
Loads the reference document and saves internally as property.
in
Model at line 837
protected bool
load_from_db(string $table_name = null, array $key_fields = [])
No description
in
Document at line 632
mixed
load_meta_data()
Returns the meta data for this document Wrapped in a public method to allow forwarding that request to link targets in the future
in
Document at line 1955
bool
lock()
Lock the referenced document
in
Document at line 1583
bool
match_mime_types($types)
Checks if the mime type of this document matches one of the given mime types.
in
DuplicatableModelTrait at line 206
protected void
onDuplicateProperties(Model $duplicate)
No description
in
DuplicatableModelTrait at line 213
protected void
onDuplicateSaved(Model $duplicate)
No description
in
DuplicatableModelTrait at line 217
protected void
onReferencesDuplicated(array $referenceMap = [])
No description
in
DocumentModel at line 932
void
onRestore()
Automatically recover document index if document model is restored
in
Document at line 2347
SearchIndexRecord
onSearchIndexUpdate(SearchIndexRecord $baseIndexRecord)
No description
in
DocumentModel at line 943
static array
parseIdRefProperty(mixed $documentIndexValues = null)
Function to parse a property which is supposed to contain id references
in
Model at line 1062
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
ScopesTrait at line 127
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 161
reload_schema()
Reloads the schema of the model
in
DocumentModel at line 230
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 259
protected bool
remove_from_db(string $table_name, array $key_fields = null)
No description
in
Document at line 744
bool
rename(string $new_filename, bool $rename_name = true)
Rename Filename Do not currently update the file_path
in
Document at line 163
string|null
render()
No description
in
DocumentModel at line 350
static void
resetRightsCache(int $document_index_id)
No description
in
ScopesTrait at line 231
void
resetScopeQuery()
Reset Scope to null
in
Document at line 2245
Document
resolve_document_id(string $document_id)
Resolve Combined IDs to a single document
in
DocumentModel at line 739
DocumentIndexReference|null
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.
in
Document at line 266
int|bool
save(bool $save_raw = false, bool $skip_category_notification = false, bool $skip_search_index_update = false, bool $createPreviewJob = true)
Save document to database
in
Document at line 677
int|bool
save_meta_data(mixed $meta)
Writes the meta data to the database Wrapped in a public method to allow forwarding this request to link targets in the future
in
Model at line 633
protected int|bool
save_to_db(string $table_name, array $params = array())
No description
in
Model at line 1381
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 81
ModelCollection
scope(string $scopeName, Query|null $scopeQuery = null)
No description
in
ScopesTrait at line 16
ModelCollection
scopeAll()
No description
in
Model at line 40
Model[]
scope_by_TABLE_COL_and_TABLE_COL2(mixed $COL1_VALUE, mixed $COL2_VALUE)
Returns unloaded ModelCollection
in
ScopesTrait at line 16
ModelCollection
scope_by_id(int|array $id)
No description
in
Model at line 40
void
self() $this find_by_id($id)
No description
in
Document at line 2491
bool
setCustomThumbnail(string|null $filePath = null)
Sets a custom thumbnail for this document. Set to FALSE to unset.
in
DocumentModel at line 148
setDocumentIndex(DocumentIndex|null $documentIndex)
Sets the related document index.
in
ScopesTrait at line 88
void
setModelCollectionReference(ModelCollection $modelCollectionReference)
No description
in
Document at line 1031
set_filename(string $filename)
Will set the filename url-friendly and without any path-information IMPORTANT: do not use the current model-set-methods it will not rename the files proper
in
Document at line 156
set_model_default_render_xui(string $model_default_render_xui)
No description
in
Model at line 599
void
set_properties_from_array(array $input, array|bool $filter = false)
No description
in
Document at line 660
set_property(string|array $property_id, mixed $property_value = false, bool $no_change = false)
No description
in
Model at line 1716
set_render_params(mixed $params = array())
Sets parameter that will be passed to the XUI helpers
in
Model at line 1756
static
set_request_cache(string $key, mixed $value)
Set Request Cache Entry
in
Document at line 793
string
set_uploaded_file(array $FILE)
Handler for uploading files (should be attached as upload_callback to the corresponding form)
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
Document at line 622
start_new_version($auto_minor_change = false)
Starts a new version (will be saved when save() is called)
in
Model at line 1675
stop_temporary_group_id_overwrite()
Stops the temporary overwrite of the table_group_id
in
Model at line 1657
void
temporarily_disable_table_group_id()
Temporarily disable the use of the group ID in all queries made
in
Model at line 1583
string
to_json()
Returns the model as JSON array
in
Model at line 1594
string
to_string()
Returns the model as STRING
in
Model at line 1536
string
to_xml(array|bool $property_filter = false, bool|DOMDocument $doc = false, DOMElement $parent_element = null)
Returns an XML of all model properties
in
Model at line 1843
void
touchProperty($propertyName)
No description
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
Document at line 1990
bool
unlock()
Remove all locks from the referenced document
in
ScopesTrait at line 56
ModelCollection
unscope(string $scopeName = null, Query|null $scopeQuery = null)
Returns an unscoped Collection
in
Document at line 713
protected
update()
Updates properties.
in
DocumentModel at line 159
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
Document at line 548
string|true
validate(array $fieldErrors)
Validate Function for Forms with Document-Models as Target