class Model extends MagicMethodHelper

This file provides autocompletion for XELOS fake system module.

All methods are accessible with $XF->system->model

Traits

Trait ObjectManager XELOS Framework

Properties

protected array $object_cache

Each object created by a success call of __call or __get will be saved into this property to avoid a multiple creation of same objects and minimize performance loss. If the multiple creation of objects is desirable e.g. in factory classes, the caching can be disabled by setting xf_trait::factory_mode to true.

from  ObjectManager
protected array $registry

The instantiation of a requested object can be processed only if the class of the object is registered with the class name as key and its information as array in this property. The element should have at least the class name or the relative path to "class" folder.

from  ObjectManager
protected string $lib_class_dir

This property contains the path to the folder served as root for all requested classes. This folder can contains other folder or classes. All requested and registered classes will be searched in this folder by concating this path with the relative path defined in the registration of the requested class. If the class is not included it will be done on the fly.

from  ObjectManager
protected string $lib_class_prefix

An optional possibility to pretend a prefix for all registered classes.

from  ObjectManager
protected string $ns_class_prefix

An optional possibility to pretend a namespace prefix for classes have no namespace yet.

from  ObjectManager
protected bool $factory_mode

This property effects the object cache. By default it is set to false to enable the object cache for all requested objects. If this property is set true, the object cache will be disabled.

from  ObjectManager
protected array $injection_objects

This is an assoc array and contains objects that will be injected into each requested object. Each containing object will be injected by the name of the key. E.g. ['mod' => $object] this would inject the property named mod with the value of $object.

from  ObjectManager
protected bool $auto_init

This property controls if the init method of requested objects is called by this trait or not.

from  ObjectManager
Controller $controller from  MagicMethodHelper
bool $_skip_errors from  MagicMethodHelper
protected null|callable $onCreateObject from  MagicMethodHelper
AuditTrail $audit_trail
AuditPolicy $audit_policy
Cron $cron
Daemon $daemon
DocumentIndex $document_index
DocumentIndexJobQueue $document_index_job_queue
DocumentIndexJobQueueHistory $document_index_job_queue_history
DocumentIndexLock $document_index_lock
DocumentIndexPolicyCluster $document_index_policy_cluster
DocumentIndexReference $document_index_reference
DocumentRegistry $document_registry
DocumentRelations $document_relations
Follows $follows
Group $group
GlobalConfig $global_config
InstanceConfig $instance_config
Hierarchy $hierarchy
HierarchyContext $hierarchy_context
HierarchyUser $hierarchy_user
HookRegistry $hook_registry
I18nLanguage $i18n_language
I18nToken $i18n_token
InstanceRegistry $instance_registry
InstanceSetup $instance_setup
LibCountry $lib_country
ModuleGroupSecurity $module_group_security
ModuleGroupSecurityMember $module_group_security_member
ModuleRegistry $module_registry
Navigation $navigation
Notification $notification
NotificationRegistry $notification_registry
OnboardingCode $onboarding_code
Pages $pages
Policy $policy
Policy2Group $policy2group
Policy2User $policy2user
RecentDocument $recent_document
ThemeSet $theme_set
User $user
UserMeta $user_meta
UserDevices $user_devices
UserGroup $user_group
$user_link
UserLog $user_log
UserPropertyLog $user_property_log
Wizard $wizard

Methods

mixed
__call($class, $args)

Magic method.

__construct(string $type, string $lib_class_prefix, Controller $controller, bool|string $old_lib_class_prefix = false, string $ns_prefix = null, string $class_suffix = '')

No description

mixed
__get($class)

Magic method.

bool
__isset($property)

Magic method.

__set($name, $value)

Magic method.

mixed
call_object($object)

No description

false|mixed|object
createObject(string $className, null $args = null)

No description

object|null
getObjectIfAvailable(string $class)

This method will return an object without killing the whole process by triggering a fatal error You can use this method if its possible that the object is not available, e.g. due to user configurations

string
get_lib_class_dir()

Returns the path to class directory.

string
get_lib_class_prefix()

Returns the defined prefix for all classes.

mixed
get_object(string $class, mixed $args = null, bool $call_init = true)

No description

array
get_object_cache()

Returns an array containing all objects were requested.

new_audit_policy()

No description

new_audit_trail()

No description

new_global_config()

No description

new_group()

No description

new_hierarchy()

No description

new_i18n_token()

No description

new_navigation()

No description

new_notification()

No description

new_policy2group()

No description

new_policy2user()

No description

new_queue()

No description

new_user_devices()

No description

new_user_meta()

No description

onCreateObject(null|callable $callable = null)

Add Custom Object Create Callback

set_injection_objects(array $objects)

Add given objects to injection object list that will be inject into object by magic call. The array should consists of property name as key and object as value.

set_lib_class_dir($lib_class_dir)

Sets the directory where classes are stored.

set_lib_class_prefix($lib_class_prefix)

Sets the class name prefix.

xelos_object_manager_init(bool $lib_class_dir, string $lib_class_prefix = '', string $ns_prefix = '')

trait constructor This method have to be called from constructor of each class that uses this trait.

Details

in ObjectManager at line 250
mixed __call($class, $args)

Magic method.

Returns the requested object. If the object is not cached, it will be instantiated with given arguments. This method calls xf_trait::get_object.

Parameters

$class
$args

Return Value

mixed

in MagicMethodHelper at line 40
__construct(string $type, string $lib_class_prefix, Controller $controller, bool|string $old_lib_class_prefix = false, string $ns_prefix = null, string $class_suffix = '')

No description

Parameters

string $type

Type ID of magic lib (e.g. model, action,...)

string $lib_class_prefix

Prefix of classes, e.g. xm_calendar

Controller $controller

Reference to Controller

bool|string $old_lib_class_prefix

Optional Alternative Class Prefix (for old modules)

string $ns_prefix
string $class_suffix

in ObjectManager at line 232
mixed __get($class)

Magic method.

First it checks if the requested property is defined and returns it if null. If not defined of null, it calls xf_trait::get_object and returns its return value.

Parameters

$class

Return Value

mixed

in ObjectManager at line 200
bool __isset($property)

Magic method.

This method checks whether the property is defined or injected by __set. If not injected or defined, it will check the registry for an entry of requested property.

Parameters

$property

Return Value

bool

in ObjectManager at line 220
__set($name, $value)

Magic method.

Sets the given value by $name

Parameters

$name
$value

in MagicMethodHelper at line 138
mixed call_object($object)

No description

Parameters

$object

Return Value

mixed

in MagicMethodHelper at line 162
false|mixed|object createObject(string $className, null $args = null)

No description

Parameters

string $className
null $args

Return Value

false|mixed|object

in ObjectManager at line 267
object|null getObjectIfAvailable(string $class)

This method will return an object without killing the whole process by triggering a fatal error You can use this method if its possible that the object is not available, e.g. due to user configurations

Parameters

string $class

Return Value

object|null

in ObjectManager at line 168
string get_lib_class_dir()

Returns the path to class directory.

Return Value

string

See also

xf_trait::lib_class_dir
xf_trait::get_lib_class_dir

in ObjectManager at line 178
string get_lib_class_prefix()

Returns the defined prefix for all classes.

Return Value

string

See also

xf_trait::lib_class_prefix

in MagicMethodHelper at line 61
mixed get_object(string $class, mixed $args = null, bool $call_init = true)

No description

Parameters

string $class
mixed $args
bool $call_init

Return Value

mixed

Exceptions

BadMethodCallException

in ObjectManager at line 188
array get_object_cache()

Returns an array containing all objects were requested.

Return Value

array

See also

xf_trait::object_cache

at line 81
AuditPolicy new_audit_policy()

No description

Return Value

AuditPolicy

at line 81
AuditTrail new_audit_trail()

No description

Return Value

AuditTrail

at line 81
DocumentIndex new_document_index()

No description

Return Value

DocumentIndex

at line 81
DocumentIndexPolicyCluster new_document_index_policy_cluster()

No description

at line 81
GlobalConfig new_global_config()

No description

Return Value

GlobalConfig

at line 81
Group new_group()

No description

Return Value

Group

at line 81
Hierarchy new_hierarchy()

No description

Return Value

Hierarchy

at line 81
HierarchyContext new_hierarchy_context()

No description

Return Value

HierarchyContext

at line 81
I18nToken new_i18n_token()

No description

Return Value

I18nToken

at line 81
InstanceConfig new_instance_config()

No description

Return Value

InstanceConfig

at line 81
Navigation new_navigation()

No description

Return Value

Navigation

at line 81
Notification new_notification()

No description

Return Value

Notification

at line 81
OnboardingCode new_onboarding_code()

No description

Return Value

OnboardingCode

at line 81
Policy2Group new_policy2group()

No description

Return Value

Policy2Group

at line 81
Policy2User new_policy2user()

No description

Return Value

Policy2User

at line 81
Queue new_queue()

No description

Return Value

Queue

at line 81
UserDevices new_user_devices()

No description

Return Value

UserDevices

at line 81
UserMeta new_user_meta()

No description

Return Value

UserMeta

in MagicMethodHelper at line 152
onCreateObject(null|callable $callable = null)

Add Custom Object Create Callback

Parameters

null|callable $callable

in ObjectManager at line 126
set_injection_objects(array $objects)

Add given objects to injection object list that will be inject into object by magic call. The array should consists of property name as key and object as value.

Parameters

array $objects

in ObjectManager at line 142
set_lib_class_dir($lib_class_dir)

Sets the directory where classes are stored.

This folder can contains other folder or classes. All requested and registered classes will be searched in this folder by concating this path with the relative path defined in the registration of the requested class. If the class is not included it will be done on the fly.

Parameters

$lib_class_dir

in ObjectManager at line 157
set_lib_class_prefix($lib_class_prefix)

Sets the class name prefix.

An optional possibility to pretend a prefix for all registered classes. This prefix is only required in the class name of the requested object. The registered class name should not contains this prefix. E.g. a class called xf_foobar should be registered as foobar.

Parameters

$lib_class_prefix

in ObjectManager at line 104
xelos_object_manager_init(bool $lib_class_dir, string $lib_class_prefix = '', string $ns_prefix = '')

trait constructor This method have to be called from constructor of each class that uses this trait.

It sets the defaults and all necessary properties.

Parameters

bool $lib_class_dir
string $lib_class_prefix

e.g. 'xf_'

string $ns_prefix

e.g. "XELOS\Framework\Lib\"