class UserSeedImport extends User

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)

STATUS_ACTIVE

STATUS_NOLOGIN

STATUS_DISABLED

Properties

Core|null $mod from  Model
protected $model_name from  User
$table_name
protected $table_use_group_id from  User
protected $table_auto_properties
protected string $table_primary_key from  Model
protected array $table_primary_compound_key from  Model
protected array $properties

ATTENTION: Custom save handler - consider on setting properties to this model

from  User
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

Defines a XUI helper which can be used to display this model in the render() function e.g. use 'thread' to use this xui helper "XELOS\Modules\Forum\UI\Thread" of the models parent module

from  Model
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

Methods

__call(string $method, array $args = array())

No description

from  Model
__clone()

Magic Function Object Cloning Make sure object references are cleaned up as each object requires a clean and separate reference

from  Model
__construct(int|bool $id = false)

No description

from  User
mixed
__get(mixed $var)

No description

from  Model
__isset($name)

No description

from  Model
__set(mixed $var, mixed $value)

No description

from  Model
string
__toString()

String Representation of this object (calls for render method)

from  Model
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

from  Model
_scopeActive(Query $Query)

Scope to only active Users

from  User
_scopeAll(Query $Query)

Global named scope scopeAll to use on models to return an unscoped unloaded collection

_scopeDefault(Query $Query)

Load default scopes

_scopeGroupId(Query $Query)

Applies Group ID Filtering

from  Model
_scope_by(string $fn, array $parameters)

Called for scopeby Magic Function Creates a new ModelCollection and applies the passed scope

_scope_custom(string $scopeName, Query|null $Query = null)

Called for scope_ Magic Function Creates a new ModelCollection and applies the passed custom scope function

string|null
add_avatar_image(string $file, string $file_type = null)

Sets the users avatar picture

from  User
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

from  Model
int
add_log(string $message, int $source_user = null, int $time = null)

Add Audit Log entry

from  User
add_scope_condition(Condition|ConditionGroup|Query|string $new_condition)

Adds a condition to scope the following find functions

Model[]
all(mixed $params = ['order_by'=>'COL1)

Return all models

from  Model
anonymize()

Trigger user meta delete and set login, email null and shorten surname of an user

from  User
void
assign_security_group(string $security_group)

No description

from  User
bool
can_see()

Determines if current working user can see this user model

from  User
bool
can_write()

Determines if current working user is able to edit this user model

from  User
clear_cached_functions(string|bool $function = false)

Clears the cache for all functions or a specific one

from  Model
clear_properties()

No description

from  Model
int
count_all() $eturns the count of all models, see $this->find('count')

No description

from  Model
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

from  Model
string|void
debug(bool $show_markers = false, int $mode = 0)

No description

from  Model
bool
delete()

Disables the user

from  User
bool
deleteUserFromSystem()

Hard delete user from system_user table. NO policy/rights check included!

from  User
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.

from  Model
void
disable_table_group_id()

Disable the use of the group ID in all queries made

from  Model
enable_field_verification($field_array, bool|string $show_flash_message = false)

Enable the verification for the passed fields The following save() call will trigger a new verification request and informs the user to confirm this change

from  User
void
enable_table_group_id()

Enable the use of the group ID in all queries made

from  Model
array
filter_user_ids_by_status(array $user_ids, array|string $status = [self::STATUS_ACTIVE, self::STATUS_NOLOGIN])

Filter a given set of user_ids and returning only user_ids with matching status

from  User
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

from  Model
ModelCollection|Model[]
find_all_by_TABLE_COL_and_TABLE_COL2($COL1_VALUE, $COL2_VALUE, $params=['order_by'=>'COL1, 5]] $)

Returns loaded ModelCollection

from  Model
find_all_by_displayname(mixed $name)

No description

from  User
find_all_by_id(mixed $id, mixed $query_params))

No description

from  User
find_all_by_user_group(string|int $security_group, int $group_security_id = 0)

Find all users belonging to a certain security group, which are NOT disabled

from  User
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

from  Model
User|null
find_by_id(int $user_id)

No description

from  User
User|null
find_by_login(string $login)

No description

from  User
functionNameToQuery(string $query, array $parameters)

Converts a findby* function name to SQL query.

from  Model
mixed
get($var)

No description

from  User
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

from  Model
getCollectionByQuery(string $model_name, array|string $dbquery_result, string $population_mode = 'full', string $post_fill_function = 'update')

No description

from  Model
array
getDBSchema(string $field = null)

Get DB Schema if available

from  Model
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"

from  Model
getI18nTokenForProperty(string $i18nProperty, int|null $limitString = null)

Gets an I18nToken for a model property (e.g. title_i18n)

from  Model
getModelCollection()

No description

from  User
int|null
getPrimaryKeyValue()

Get the primary id (post_id) for this model

from  Model
array
getPropertyMarkers(bool $value_discovery = true)

Return properties and markers

from  Model
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

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

from  Model
string
get_avatar_url(int|string|bool $width = 'auto', int|string|bool $height = 'auto')

Returns the URL for the user avatar

from  User
string
get_created_at_formatted()

Return a Formatted DateTime

from  Model
string
get_current_online_status()

Returns the current online status of the current user

from  User
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

from  Model
get_fullname()

No description

from  User
string
get_i18n_language(bool $culture_only = false, bool $fallback_language = true)

Return Language like $culture_only false = "EN_GB" $culture_only true = "GB"

from  User
bool|mixed
get_i18n_property(string $property, string $force_language = false)

Return the property translated property value if available

from  Model
string|null
get_model_name()

Returns the SQL table of this model (if available)

from  Model
string|bool
get_model_table_name(string $table_name = null)

Returns the SQL table of this model (if available)

from  Model
get_online_status_mapping()

Returns a list of available status types incl. label

from  User
get_portrait_url(int $width = 'auto', int $height = 'auto')

put your comment there.

from  User
array
get_properties(bool $value_discovery = true)

Returns the complete properties array

from  User
array
get_properties_meta(?string $field = null)

No description

from  Model
mixed
get_property(string|null $property_id, bool $get_raw_value = false)

No description

from  User
static mixed|null
get_request_cache(string $key)

Return Cache Entry if it exists

from  Model
array
get_short_profile(string $profile_type = false, int $image_width = false, int $image_height = false)

Returns an array with a short user profile depending on the installed helpers and modules the source can be e.g. system profile or lookbook

from  User
string|null
get_table_name()

Returns the table name of this model.

from  Model
string|null
get_table_primary_key()

No description

from  Model
string
get_updated_at_formatted()

Return a Formatted DateTime

from  Model
int[]
get_user_groups(bool $force_reload = false)

No description

from  User
int
get_user_id()

No description

from  User
array
get_user_ids_by_security_group(int $system_group_id, array|string $status = [self::STATUS_ACTIVE, self::STATUS_NOLOGIN])

No description

from  User
bool|mixed|string
get_user_pic(string $pic_type = null, int|string $width = 'auto', int|string $height = 'auto')

No description

from  User
mixed
get_user_setting($var, string $instance_id = 'GLOBAL')

No description

from  User
bool
hasChangedProperties()

No description

from  Model
bool
hasExistingDatabaseRecord()

Does this model represent an existing database record? (can be updated)

from  Model
bool
hasTouchedProperties()

Returns true if at least one property is marked as changed

from  Model
bool
in_group($group_id)

Check if User is in a specific group

from  User
init(bool $auto_load = true)

No description

from  User
bool
isAnonymized()

No description

from  User
is_online()

Returns true if the current user is online

from  User
load()

No description

from  Model
bool
load_from_db(string $table_name = null, array $key_fields = [])

No description

from  Model
load_meta()

No description

from  User
load_unverified()

No description

from  User
load_user_groups()

No description

from  User
string
parse_template(string $template, bool $urlencode = false)

Parse Template for User Properties

from  User
parse_template_cb($matches)

No description

from  User
populate_model_by_query(string $model_name, array|string $dbquery_result, string $population_mode = 'full', string $post_fill_function = 'update') deprecated

No description

from  Model
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

reload_schema()

Reloads the schema of the model

from  Model
bool
remove_from_db(string $table_name, array $key_fields = null)

No description

from  Model
void
remove_security_group(string $security_group)

No description

from  User
string|null
render()

Generic Renderer

from  User
void
resetScopeQuery()

Reset Scope to null

int|bool
save($change_message = false)

No description

save_meta()

No description

from  User
int|bool
save_to_db(string $table_name, array $params = array())

No description

from  Model
save_unverified()

Save properties which require verification

from  User
bool|array
schema_values(mixed $field_name)

Provides a list of all values allowed for enumerations.

from  Model
scope(string $scopeName, Query|null $scopeQuery = null)

No description

scopeAll()

No description

Model[]
scope_by_TABLE_COL_and_TABLE_COL2(mixed $COL1_VALUE, mixed $COL2_VALUE)

Returns unloaded ModelCollection

from  Model
scope_by_id(int|array $id)

No description

void
self() $this find_by_id($id)

No description

from  Model
set($var, $value)

No description

from  User
void
setModelCollectionReference(ModelCollection $modelCollectionReference)

No description

bool
set_current_password_check(string $old_password)

If old_password_check propert is filled the new_password() change will only be triggered if the passed value matches the old password and the model will not validate

from  User
string
set_new_password(null $new_password = null, int $force_password_change = 0, bool $silent = false)

No description

void
set_properties_from_array(array $input, array|bool $filter = false)

No description

from  Model
set_property(string|array $property_id, mixed $property_value = false, bool $no_change = false)

Set user property

from  User
set_render_params(mixed $params = array())

Sets parameter that will be passed to the XUI helpers

from  Model
static 
set_request_cache(string $key, mixed $value)

Set Request Cache Entry

from  Model
void
set_security_group(mixed $security_groups)

No description

from  User
bool
set_user_setting(mixed $variable, mixed $value, mixed $instance_id = false, mixed $module_name = false)

Set a Userconfig Setting

from  User
void
sortMoveTo(int $id, int $sortTo, array|null $conditions = [])

Sort this element to a specific position

sort_down(int $steps = 1, $params = array())

Decrease Sort Priority (Increases SORT value)

sort_up(int $steps = 1, $params = array())

Increase Sort Priority (Decreases SORT value)

stop_temporary_group_id_overwrite()

Stops the temporary overwrite of the table_group_id

from  Model
void
temporarily_disable_table_group_id()

Temporarily disable the use of the group ID in all queries made

from  Model
string
to_json()

Returns the model as JSON array

from  Model
string
to_string()

Returns the model as STRING

from  Model
string
to_xml(array|bool $property_filter = false, bool|DOMDocument $doc = false, DOMElement $parent_element = null)

Returns an XML of all model properties

from  Model
void
touchProperty($propertyName)

No description

from  Model
unscope(string $scopeName = null, Query|null $scopeQuery = null)

Returns an unscoped Collection

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)

string|true
validate(array $fieldErrors)

Validate User Model Changes

from  User

Details

in Model at line 1117
ModelCollection|Model|Model[]|int __call(string $method, array $args = array())

No description

Parameters

string $method method-name
array $args params

Return Value

ModelCollection|Model|Model[]|int
  • Returns resource (find...) or affected rows (count..|deleted..)

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 User at line 143
__construct(int|bool $id = false)

No description

Parameters

int|bool $id

Primary ID of the model which should be loaded

in Model at line 1093
mixed __get(mixed $var)

No description

Parameters

mixed $var

Return Value

mixed

in Model at line 1743
__isset($name)

No description

Parameters

$name

in Model at line 1105
Model __set(mixed $var, mixed $value)

No description

Parameters

mixed $var
mixed $value

Return Value

Model

in Model at line 1695
string __toString()

String Representation of this object (calls for render method)

Return Value

string

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

Parameters

string $function method-name
array $args params

Return Value

mixed

in User at line 137
Query _scopeActive(Query $Query)

Scope to only active Users

Parameters

Query $Query

Return Value

Query

in ScopesTrait at line 100
Query _scopeAll(Query $Query)

Global named scope scopeAll to use on models to return an unscoped unloaded collection

Parameters

Query $Query Query

Return Value

Query

in ScopesTrait at line 111
Query _scopeDefault(Query $Query)

Load default scopes

Parameters

Query $Query

Return Value

Query

in Model at line 1631
protected Query _scopeGroupId(Query $Query)

Applies Group ID Filtering

Parameters

Query $Query

Return Value

Query

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

Parameters

string $fn
array $parameters

Return Value

ModelCollection

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

Parameters

string $scopeName

Name of the custom scope - e.g. Active - calls _scopeActive() on the model

Query|null $Query

Return Value

ModelCollection

in User at line 921
string|null add_avatar_image(string $file, string $file_type = null)

Sets the users avatar picture

Parameters

string $file

HDD File Path OR http:// remote URL string

string $file_type

The type of the file

Return Value

string|null

Image name if the file has been created, NULL if the creation was not successful

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

Parameters

string $property

Property of models to format

string $format

Format Type (e.g. money, date, ...)

array $options

Additional format options

in User at line 636
int add_log(string $message, int $source_user = null, int $time = null)

Add Audit Log entry

Parameters

string $message
int $source_user

(User causing this)

int $time

Unix TS

Return Value

int

in ScopesTrait at line 34
ModelCollection add_scope_condition(Condition|ConditionGroup|Query|string $new_condition)

Adds a condition to scope the following find functions

Parameters

Condition|ConditionGroup|Query|string $new_condition

Return Value

ModelCollection

in Model at line 40
Model[] all(mixed $params = ['order_by'=>'COL1)

Return all models

Parameters

mixed $params

Return Value

Model[]

in User at line 1428
anonymize()

Trigger user meta delete and set login, email null and shorten surname of an user

in User at line 459
void assign_security_group(string $security_group)

No description

Parameters

string $security_group

ID or name

Return Value

void

in User at line 303
bool can_see()

Determines if current working user can see this user model

Return Value

bool

See also

UserCollection::filterByIsVisible

in User at line 288
bool can_write()

Determines if current working user is able to edit this user model

Return Value

bool

See also

UserCollection::filterByIsWriteable

in Model at line 1174
clear_cached_functions(string|bool $function = false)

Clears the cache for all functions or a specific one

Parameters

string|bool $function

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

Parameters

) $eturns the count of all models
see $this->find('count'

Return Value

int

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

Parameters

mixed $COL1_VALUE
mixed $COL2_VALUE

Return Value

int

in Model at line 939
string|void debug(bool $show_markers = false, int $mode = 0)

No description

Parameters

bool $show_markers

show markers as well?

int $mode

(0 - print, 1 - return, 2 and 3 - Special PopUps)

Return Value

string|void

in User at line 1498
bool delete()

Disables the user

Return Value

bool

was delete successful?

in User at line 1485
bool deleteUserFromSystem()

Hard delete user from system_user table. NO policy/rights check included!

Return Value

bool

Success of delete operation

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.

Parameters

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'

Return Value

int

in Model at line 1642
void disable_table_group_id()

Disable the use of the group ID in all queries made

Return Value

void

in User at line 346
enable_field_verification($field_array, bool|string $show_flash_message = false)

internal  param $array
 

Enable the verification for the passed fields The following save() call will trigger a new verification request and informs the user to confirm this change

Parameters

$field_array
bool|string $show_flash_message

in Model at line 1667
void enable_table_group_id()

Enable the use of the group ID in all queries made

Return Value

void

in User at line 422
array filter_user_ids_by_status(array $user_ids, array|string $status = [self::STATUS_ACTIVE, self::STATUS_NOLOGIN])

Filter a given set of user_ids and returning only user_ids with matching status

Parameters

array $user_ids
array|string $status

[active, no_login, disabled]

Return Value

array

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

Parameters

string $mode

Find mode (all/first/count)

Condition|ConditionGroup|Query|string|array $conditions

Conditions passed as field query string (e.g. 'id=1 and name="TEST"') or as legacy array: First Element contains query, 2..n contain Parameters

array|null $query_params

Further query parameters (e.g. limit, order_by, request_cache)

Return Value

ModelCollection|Model|int|null

depending from $mode: ALL: ModelCollection; FIRST: Model | boolean false on fail COUNT: int

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

Parameters

$COL1_VALUE
$COL2_VALUE
$params=['order_by'=>'COL1
5]] $

Return Value

ModelCollection|Model[]

in User at line 53
UserCollection find_all_by_displayname(mixed $name)

No description

Parameters

mixed $name

Return Value

UserCollection

in User at line 53
UserCollection find_all_by_id(mixed $id, mixed $query_params))

No description

Parameters

mixed $id
mixed $query_params)

Return Value

UserCollection

in User at line 1550
ModelCollection find_all_by_user_group(string|int $security_group, int $group_security_id = 0)

Find all users belonging to a certain security group, which are NOT disabled

Cleanup? - Unused

Parameters

string|int $security_group

Can be group or role e.g. admin,user,1,2

int $group_security_id

Filter by Group Security ID

Return Value

ModelCollection

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

Parameters

mixed $COL_VALUE
mixed $params

Return Value

Model

in User at line 53
User|null find_by_id(int $user_id)

No description

Parameters

int $user_id

Return Value

User|null

in User at line 53
User|null find_by_login(string $login)

No description

Parameters

string $login

Return Value

User|null

in Model at line 1402
protected Query functionNameToQuery(string $query, array $parameters)

Converts a findby* function name to SQL query.

Parameters

string $query
array $parameters

Return Value

Query

Returns a Query Object with the relevant WHERE Scopes

in User at line 211
mixed get($var)

No description

Parameters

$var

Return Value

mixed

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

Parameters

bool $returnOldValues

Return values before change or current value after change?

Return Value

array ['property_key'=>'property_value']

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

Parameters

string $model_name

Model Name, eg.g. category

array|string $dbquery_result

dbquery Result with one record per model OR SQL query

string $population_mode

Population Mode (full or id) - If set to full all object data will be used to fill the objects, if set to id each model will be initialized with the corresponding record id as parameter

string $post_fill_function

Post-Fill Function is triggered on the each model after an object has been filled with data

Return Value

ModelCollection

Always returns a model collection

in Model at line 191
array getDBSchema(string $field = null)

Get DB Schema if available

Parameters

string $field

Return Value

array

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"

Parameters

$propertyName
$localeAsKey

Return Value

string[]

in Model at line 1914
I18nTokenHelper getI18nTokenForProperty(string $i18nProperty, int|null $limitString = null)

Gets an I18nToken for a model property (e.g. title_i18n)

Parameters

string $i18nProperty

The property name (e.g. title_i18n)

int|null $limitString

The translated string will be only $limitString amount of characters long (Adds '...' at the end of the string)

Return Value

I18nTokenHelper

in User at line 53
UserCollection getModelCollection()

No description

Return Value

UserCollection

in Model at line 334
int|null getPrimaryKeyValue()

Get the primary id (post_id) for this model

Return Value

int|null

in Model at line 492
array getPropertyMarkers(bool $value_discovery = true)

Return properties and markers

Parameters

bool $value_discovery

Return Value

array

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

Parameters

bool $applyDefaultScopes

Return Value

Query

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

Parameters

bool $returnOldValues

Return values before change or current value after change?

Return Value

array ['property_key'=>'property_value']

in User at line 1169
string get_avatar_url(int|string|bool $width = 'auto', int|string|bool $height = 'auto')

Returns the URL for the user avatar

Parameters

int|string|bool $width

int :: width-dimension (in pixels) of the image to be scaled to string 'auto' :: using automatic Cropping with system-default width-dimension boolean FALSE :: disabling automatic Cropping and Scaling (if height-scaling is disabled too)

int|string|bool $height

int :: height-dimension (in pixels) of the image to be scaled to string 'auto' :: using automatic Cropping with system-default height-dimension boolean FALSE :: disabling automatic Cropping and Scaling (if width-scaling is disabled too)

Return Value

string

in Model at line 1611
string get_created_at_formatted()

Return a Formatted DateTime

Return Value

string

in User at line 1397
string get_current_online_status()

Returns the current online status of the current user

Return Value

string

online, offline, away, dnd

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

Return Value

array ['id'=>'1','example_prop'=>'example_val','created_at'=>'']

in User at line 505
get_fullname()

No description

in User at line 1521
string get_i18n_language(bool $culture_only = false, bool $fallback_language = true)

Return Language like $culture_only false = "EN_GB" $culture_only true = "GB"

Parameters

bool $culture_only
bool $fallback_language

Return Value

string

in Model at line 1784
bool|mixed get_i18n_property(string $property, string $force_language = false)

Return the property translated property value if available

Parameters

string $property

e.g. title_i18n

string $force_language

FALSE will use current user language, otherwise the passed LOCALE will be used

Return Value

bool|mixed

in Model at line 351
string|null get_model_name()

Returns the SQL table of this model (if available)

Return Value

string|null

Full qualified table name e.g. xmi_crm01_contact

in Model at line 312
string|bool get_model_table_name(string $table_name = null)

Returns the SQL table of this model (if available)

Parameters

string $table_name

Simple table without instance or system prefix

Return Value

string|bool

Full qualified table name e.g. xmi_crm01_contact

in User at line 1416
get_online_status_mapping()

Returns a list of available status types incl. label

in User at line 1019
get_portrait_url(int $width = 'auto', int $height = 'auto')

put your comment there.

..

Parameters

int $width
int $height

in User at line 276
array get_properties(bool $value_discovery = true)

Returns the complete properties array

Parameters

bool $value_discovery

Retrieve all values by get_property access method

Return Value

array

in Model at line 508
array get_properties_meta(?string $field = null)

No description

Parameters

?string $field

if given returns the meta for that field

Return Value

array

in User at line 215
mixed get_property(string|null $property_id, bool $get_raw_value = false)

No description

Parameters

string|null $property_id

Marker ID

bool $get_raw_value

deactivate Marker-Function gets triggered

Return Value

mixed

Marker Content

in Model at line 1772
static mixed|null get_request_cache(string $key)

Return Cache Entry if it exists

Parameters

string $key

Cache Key

Return Value

mixed|null

in User at line 750
array get_short_profile(string $profile_type = false, int $image_width = false, int $image_height = false)

Returns an array with a short user profile depending on the installed helpers and modules the source can be e.g. system profile or lookbook

Parameters

string $profile_type

profile type can be avatar or profile

int $image_width

The width the image should be resized to

int $image_height

The height the image should be resized to

Return Value

array

contains the user data: displayname

in Model at line 303
string|null get_table_name()

Returns the table name of this model.

Return Value

string|null

in Model at line 325
string|null get_table_primary_key()

No description

Return Value

string|null

Primary Key Field in DB

in Model at line 1620
string get_updated_at_formatted()

Return a Formatted DateTime

Return Value

string

in User at line 1339
int[] get_user_groups(bool $force_reload = false)

No description

Parameters

bool $force_reload

Return Value

int[]

in User at line 513
int get_user_id()

No description

Return Value

int

User ID

in User at line 408
array get_user_ids_by_security_group(int $system_group_id, array|string $status = [self::STATUS_ACTIVE, self::STATUS_NOLOGIN])

No description

Parameters

int $system_group_id
array|string $status

[active, no_login, disabled]

Return Value

array

in User at line 895
bool|mixed|string get_user_pic(string $pic_type = null, int|string $width = 'auto', int|string $height = 'auto')

No description

Parameters

string $pic_type

Picture Type ['avatar','portrait']

int|string $width
int|string $height

Return Value

bool|mixed|string

in User at line 845
mixed get_user_setting($var, string $instance_id = 'GLOBAL')

No description

Parameters

$var
string $instance_id

Return Value

mixed

in Model at line 1868
bool hasChangedProperties()

No description

Return Value

bool

in Model at line 807
bool hasExistingDatabaseRecord()

Does this model represent an existing database record? (can be updated)

Return Value

bool

in Model at line 1835
bool hasTouchedProperties()

Returns true if at least one property is marked as changed

Return Value

bool

in User at line 1353
bool in_group($group_id)

Check if User is in a specific group

Parameters

$group_id

Return Value

bool success

in User at line 163
init(bool $auto_load = true)

No description

Parameters

bool $auto_load

If set to false the init will NOT TRIGGER load in case of a set primary key property

Exceptions

Exception

in User at line 1453
bool isAnonymized()

No description

Return Value

bool

in User at line 1370
is_online()

Returns true if the current user is online

qreturn bool online

in Model at line 390
load()

No description

in Model at line 837
protected bool load_from_db(string $table_name = null, array $key_fields = [])

No description

Parameters

string $table_name

Table Name

array $key_fields

Key fields which should be used as WHERE condition

Return Value

bool

in User at line 310
load_meta()

No description

in User at line 323
load_unverified()

No description

in User at line 1308
protected load_user_groups()

No description

in User at line 707
string parse_template(string $template, bool $urlencode = false)

Parse Template for User Properties

Parameters

string $template

with markers in curly brackets: {firstname}, {user_pic}

bool $urlencode

Set to true if each replaced value should be urlencoded

Return Value

string

in User at line 712
parse_template_cb($matches)

No description

Parameters

$matches

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 Please use getCollectionByQuery() instead

No description

Parameters

string $model_name

Model Name, eg.g. category

array|string $dbquery_result

dbquery Result with one record per model OR SQL query

string $population_mode

Population Mode (full or id) - If set to full all object data will be used to fill the objects, if set to id each model will be initialized with the corresponding record id as parameter

string $post_fill_function

Post-Fill Function is triggered on the each model after an object has been filled with data

Return Value

ModelCollection|Model[]

empty array if none found and compatibility-mode on (xelos model_version < 1)

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

Parameters

$scopeName

Return Value

void

in Model at line 161
reload_schema()

Reloads the schema of the model

in Model at line 904
protected bool remove_from_db(string $table_name, array $key_fields = null)

No description

Parameters

string $table_name

Table Name

array $key_fields

Key fields which should be used as WHERE condition

Return Value

bool

in User at line 480
void remove_security_group(string $security_group)

No description

Parameters

string $security_group

ID or name

Return Value

void

in User at line 1506
string|null render()

Generic Renderer

Return Value

string|null

in ScopesTrait at line 231
void resetScopeQuery()

Reset Scope to null

Return Value

void

at line 16
int|bool save($change_message = false)

No description

Parameters

$change_message

Return Value

int|bool

Integer represents ID of saved record, true for successful modifications (update, delete), false otherwise

in User at line 354
save_meta()

No description

in Model at line 633
protected int|bool save_to_db(string $table_name, array $params = array())

No description

Parameters

string $table_name

Table Name

array $params

Return Value

int|bool

Integer represents ID of saved record, true for successful modifications (update, delete), false otherwise

Exceptions

DatabaseException

in User at line 377
save_unverified()

Save properties which require verification

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

Parameters

mixed $field_name

The name of the field to examine

Return Value

bool|array

in ScopesTrait at line 81
ModelCollection scope(string $scopeName, Query|null $scopeQuery = null)

No description

Parameters

string $scopeName
Query|null $scopeQuery

Return Value

ModelCollection

in ScopesTrait at line 16
ModelCollection scopeAll()

No description

Return Value

ModelCollection

in Model at line 40
Model[] scope_by_TABLE_COL_and_TABLE_COL2(mixed $COL1_VALUE, mixed $COL2_VALUE)

Returns unloaded ModelCollection

Parameters

mixed $COL1_VALUE
mixed $COL2_VALUE

Return Value

Model[]

in ScopesTrait at line 16
ModelCollection scope_by_id(int|array $id)

No description

Parameters

int|array $id

Return Value

ModelCollection

in Model at line 40
void self() $this find_by_id($id)

No description

Parameters

) $this find_by_id($id

Return Value

void

in User at line 501
set($var, $value)

No description

Parameters

$var
$value

in ScopesTrait at line 88
void setModelCollectionReference(ModelCollection $modelCollectionReference)

No description

Parameters

ModelCollection $modelCollectionReference

Return Value

void

in User at line 1237
bool set_current_password_check(string $old_password)

If old_password_check propert is filled the new_password() change will only be triggered if the passed value matches the old password and the model will not validate

Parameters

string $old_password

Return Value

bool

at line 12
string set_new_password(null $new_password = null, int $force_password_change = 0, bool $silent = false)

No description

Parameters

null $new_password

New Password (False = Autogenerate)

int $force_password_change
bool $silent

Suppress Warning / Notification Email

Return Value

string

New Password

in Model at line 599
void set_properties_from_array(array $input, array|bool $filter = false)

No description

Parameters

array $input

Assoc array with field_id=>value

array|bool $filter

Filter array with 1-dim field_id's, only these keys from input will be set

Return Value

void

in User at line 233
set_property(string|array $property_id, mixed $property_value = false, bool $no_change = false)

Set user property

Parameters

string|array $property_id

Marker ID (Can also be an Array)

mixed $property_value Value
bool $no_change

Value

return static

in Model at line 1716
set_render_params(mixed $params = array())

Sets parameter that will be passed to the XUI helpers

Parameters

mixed $params

in Model at line 1756
static set_request_cache(string $key, mixed $value)

Set Request Cache Entry

Parameters

string $key
mixed $value

in User at line 438
void set_security_group(mixed $security_groups)

No description

Parameters

mixed $security_groups
  • can be id, name or multiples thereof (array or comma sep)

Return Value

void

in User at line 881
bool set_user_setting(mixed $variable, mixed $value, mixed $instance_id = false, mixed $module_name = false)

Set a Userconfig Setting

Parameters

mixed $variable
mixed $value
mixed $instance_id
mixed $module_name

Return Value

bool Success

in SortTrait at line 116
void sortMoveTo(int $id, int $sortTo, array|null $conditions = [])

Sort this element to a specific position

Parameters

int $id

The record ID you intend to move, use 0 if your model has not been saved yet and you intend to save it to the given sort

int $sortTo

Move element to this new position, should be > 0

array|null $conditions

Add conditions

Return Value

void

in SortTrait at line 28
sort_down(int $steps = 1, $params = array())

Decrease Sort Priority (Increases SORT value)

Parameters

int $steps
$params

in SortTrait at line 17
sort_up(int $steps = 1, $params = array())

Increase Sort Priority (Decreases SORT value)

Parameters

int $steps
$params

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

Return Value

void

in Model at line 1583
string to_json()

Returns the model as JSON array

Return Value

string

Returns model string

in Model at line 1594
string to_string()

Returns the model as STRING

Return Value

string

Returns 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

Parameters

array|bool $property_filter

if given, only the properties in this array are added

bool|DOMDocument $doc

used from model_collection to add this model to an existing structure

DOMElement $parent_element

to add this model as Child, necessary if doc is given

Return Value

string

Returns formatted XML string

in Model at line 1843
void touchProperty($propertyName)

No description

Parameters

$propertyName

Return Value

void

in ScopesTrait at line 56
ModelCollection unscope(string $scopeName = null, Query|null $scopeQuery = null)

Returns an unscoped Collection

Parameters

string $scopeName
Query|null $scopeQuery

Provide a specific Query Object you want to unscope

Return Value

ModelCollection

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)

Parameters

mixed $id

(The record ID you intend to move )

string $direction

(The direction you want the record to move)

int $steps

(The amount of steps you want the record to move)

array $params

key 'filter' optional conditions passed as a key-value array. Key 'order_by' additional ORDER string append to ORDER BY sort

Return Value

int

new Sort Value

in User at line 1252
string|true validate(array $fieldErrors)

Validate User Model Changes

Parameters

array $fieldErrors

Field Errors can be returned via reference as array(array('field'=>$field, 'err_msg'=>$error)) or array($field => $error)

Return Value

string|true

TRUE if everything is correct, String for Error-Message