class TranslationFeedback extends Model

Class Translation

Traits

This file provides property and method documentation for the model TranslationFeedback.

Properties

TranslationController $mod
protected $model_name var string Name of this model e.g. category or document from Model
protected $table_name
protected boolean $table_use_group_id from Model
protected $table_auto_properties
protected string $table_primary_key from Model
protected array $model_scope_conditions from Model
protected array $properties from Model
protected array $properties_meta from Model
protected array $markers from Model
protected array $properties_null_values from Model
static $method_exists_cache 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
boolean $loaded from Model
boolean $saved from Model
array $changed from Model
array $cache_function_result from Model
static array $_request_cache from Model
int $id from TranslationFeedbackDocumentation
int $user_id from TranslationFeedbackDocumentation
string $source_model: enum translation_document|translation from TranslationFeedbackDocumentation
int $source_id from TranslationFeedbackDocumentation
string $content: stored in MySQL as mediumtext from TranslationFeedbackDocumentation
string $hash: stored in MySQL as varchar from TranslationFeedbackDocumentation
string $target_language: stored in MySQL as varchar from TranslationFeedbackDocumentation
int $created_at: stored in MySQL as timestamp from TranslationFeedbackDocumentation
int $updated_at: stored in MySQL as timestamp from TranslationFeedbackDocumentation
protected $sourceModel

Methods

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

No description

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

No description

from Model
mixed
__get(mixed $var)

No description

from Model
__isset($name)

No description

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

No description

from Model
null|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
_scope_by(mixed $fn, mixed $parameters)

put your comment there.

from Model
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
add_scope_condition(mixed $condition)

Adds a condition to scope the following find functions

from Model
can_read()

No description

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
array
convert_array_to_conditions(array $params = array())

Convert Assoc Multidimensional Array to Model Conditional Array

from Model
int
count_all($sql_params = false)

Returns the count

string|void
debug(boolean $show_markers = false, int $mode = 0)

No description

from Model
boolean
delete()

Deletes model and also deletes possible related translation_job models

int
delete_by_TABLE_COL($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
int
delete_by_id(int $id, $sql_params = false)

Delete rows specified by condition and returns the affected rows.

disable_table_group_id()

Disable the use of the group ID in all queries made

from Model
enable_table_group_id()

Enable the use of the group ID in all queries made

from Model
mixed
find(string $mode = 'all', mixed $conditions = false, mixed $query_params = false)

Find Function to find models using the passed condition

from Model
Model
find_by_TABLE_COL($COL_VALUE, $params = ['order_by'=>'COL1 ASC'])

Returns all models with a specific column value. Query params can be e.g. order_by

from Model
find_by_id($sql_params = false)

Returns all models by id and ids. Query params can be e.g. order_by

TranslationFeedback
find_by_source_model_and_source_id_and_target_language(string $source_model, int $id, string $language, $sql_params = false)

No description

string
function_name_to_query(string $query, array $parameters)

Converts a find_by_* function name to SQL query.

from Model
bool|mixed|null
getSourceAutoTranslationForLanguage(string $language)

Get the original auto translation from the source model for $language

string|null
getSourceContent()

Get the original content of the source

string|null
getSourceLanguage()

Get the original_language field of the source model

getSourceModel()

Returns the source Translation model for which this model is the feedback/improved translation

string
get_created_at_formatted()

Return a Formatted DateTime

from Model
get_db_properties()

Returns all properties which are available as DB field (= can be used as find_by() properties)

from Model
bool|mixed
get_i18n_property(string $property)

Return the property translated property value if available

from Model
string
get_model_name()

Returns the SQL table of this model (if available)

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

Returns the SQL table of this model (if available)

from Model
get_properties(bool $value_discovery = true)

No description

from Model
get_properties_meta(bool|string $field = false)

No description

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

No description

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

Return Cache Entry if it exists

from Model
string
get_table_name()

Returns the table name of this model.

from Model
string
get_table_primary_key()

No description

from Model
string
get_updated_at_formatted()

Return a Formatted DateTime

from Model
init(bool $auto_load = true)

Initializes the model

from Model
load()

No description

from Model
bool
load_from_db(string $table_name, array|bool $key_fields = false)

No description

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

No description

from Model
array
process_find_query(mixed $select_field, mixed $query_params)

Execute Query of find() function. Can be modified by child class if necessary

from Model
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
null
render()

Generic Renderer

from Model
save()

No description

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

No description

from Model
bool|array
schema_values(mixed $field_name)

Provides a list of all values allowed for enumerations.

from Model
array
search(string $query, array $field_list, mixed $query_params = false)

Search for passed search query in all passed fields, one match is enough

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

No description

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

Set a Property. If $property_id is an array and $property_value is false, set_property is called for each element in the array with the array key and value as params.

from Model
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
sort_down(int $steps = 1, array $params = array())

Decrease Sort Priority (Increases SORT value)

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

Increase Sort Priority (Decreases SORT value)

from Model
stop_temporary_group_id_overwrite()

Stops the temporary overwrite of the table_group_id

from Model
temporarily_disable_table_group_id()

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

from Model
temporarily_enable_table_group_id()

Temporarily enables 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
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)

from Model
string|true
validate(array $fieldErrors)

No description

from Model

Details

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

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 119
__construct(int|bool $id = false)

Parameters

int|bool $id Primary ID of the model which should be loaded

Exceptions

ReflectionException

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

Parameters

mixed $var

Return Value

mixed

in Model at line 1570
__isset($name)

Parameters

$name

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

Parameters

mixed $var
mixed $value

Return Value

mixed

in Model at line 1527
null|string __toString()

String Representation of this object (calls for render method)

Return Value

null|string

in Model at line 998
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 Model at line 1240
protected ModelCollection _scope_by(mixed $fn, mixed $parameters)

put your comment there.

..

Parameters

mixed $fn
mixed $parameters

Return Value

ModelCollection

in Model at line 810
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 Model at line 1228
add_scope_condition(mixed $condition)

Adds a condition to scope the following find functions

Parameters

mixed $condition

at line 25
can_read()

in Model at line 1017
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 486
clear_properties()

in Model at line 1195
array convert_array_to_conditions(array $params = array())

Convert Assoc Multidimensional Array to Model Conditional Array

Parameters

array $params ['id'=>1,'type'=>'active']

Return Value

array ["id = 1","type = 'active'"]

int count_all($sql_params = false)

Returns the count

Parameters

$sql_params

Return Value

int

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

Parameters

boolean $show_markers show markers as well?
int $mode (0 - print, 1 - return, 2 and 3 - Special PopUps)

Return Value

string|void

at line 106
boolean delete()

Deletes model and also deletes possible related translation_job models

Return Value

boolean was delete successful?

in Model at line 29
int delete_by_TABLE_COL($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

$COL_VALUE

Return Value

int

int delete_by_id(int $id, $sql_params = false)

Delete rows specified by condition and returns the affected rows.

Parameters

int $id
$sql_params

Return Value

int

in Model at line 1480
disable_table_group_id()

Disable the use of the group ID in all queries made

in Model at line 1503
enable_table_group_id()

Enable the use of the group ID in all queries made

in Model at line 1066
mixed find(string $mode = 'all', mixed $conditions = false, mixed $query_params = false)

Find Function to find models using the passed condition

Parameters

string $mode Find mode (all/first/count)
mixed $conditions Conditions passed as field query string (e.g. 'id=1 and name="TEST"') or as parameter array: First Element contains query, 2..n contain Parameters
mixed $query_params Further query parameters (e.g. limit, order_by, request_cache)

Return Value

mixed by_mode [ ALL: ModelCollection; FIRST: Model | boolean false on fail ]

in Model at line 29
Model find_by_TABLE_COL($COL_VALUE, $params = ['order_by'=>'COL1 ASC'])

Returns all models with a specific column value. Query params can be e.g. order_by

Parameters

$COL_VALUE
$params

Return Value

Model

TranslationFeedback find_by_id($sql_params = false)

Returns all models by id and ids. Query params can be e.g. order_by

Parameters

$sql_params

Return Value

TranslationFeedback

at line 15
TranslationFeedback find_by_source_model_and_source_id_and_target_language(string $source_model, int $id, string $language, $sql_params = false)

Parameters

string $source_model
int $id
string $language
$sql_params

Return Value

TranslationFeedback

in Model at line 1275
string function_name_to_query(string $query, array $parameters)

Converts a find_by_* function name to SQL query.

Parameters

string $query
array $parameters

Return Value

string Returns the where condition

at line 91
bool|mixed|null getSourceAutoTranslationForLanguage(string $language)

Get the original auto translation from the source model for $language

Parameters

string $language The language to get the auto translation for (e.g.: 'DE_DE')

Return Value

bool|mixed|null

at line 59
string|null getSourceContent()

Get the original content of the source

Return Value

string|null The original content string

at line 74
string|null getSourceLanguage()

Get the original_language field of the source model

Return Value

string|null The language string ('DE_DE', ...)

at line 35
Translation|TranslationDocument|null getSourceModel()

Returns the source Translation model for which this model is the feedback/improved translation

Return Value

Translation|TranslationDocument|null

in Model at line 1462
string get_created_at_formatted()

Return a Formatted DateTime

Return Value

string

in Model at line 404
get_db_properties()

Returns all properties which are available as DB field (= can be used as find_by() properties)

in Model at line 1610
bool|mixed get_i18n_property(string $property)

Return the property translated property value if available

Parameters

string $property e.g. title_i18n

Return Value

bool|mixed

in Model at line 278
string get_model_name()

Returns the SQL table of this model (if available)

Return Value

string Full qualified table name e.g. xmi_crm01_contact

in Model at line 257
string|bool get_model_table_name(string|bool $table_name = false)

Returns the SQL table of this model (if available)

Parameters

string|bool $table_name Simple table without instance or system prefix

Return Value

string|bool Full qualified table name e.g. xmi_crm01_contact

in Model at line 372
get_properties(bool $value_discovery = true)

Parameters

bool $value_discovery Retrieve all values by get_property access method

in Model at line 393
get_properties_meta(bool|string $field = false)

Parameters

bool|string $field if given returns the meta for that field

in Model at line 347
get_property(string $property_id, bool $get_raw_value = false)

Parameters

string $property_id Marker ID
bool $get_raw_value deactivate Marker-Function gets triggered

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

Return Cache Entry if it exists

Parameters

string $key Cache Key

Return Value

mixed|null

in Model at line 140
string get_table_name()

Returns the table name of this model.

Return Value

string

in Model at line 270
string get_table_primary_key()

Return Value

string Primary Key Field in DB

in Model at line 1471
string get_updated_at_formatted()

Return a Formatted DateTime

Return Value

string

in Model at line 175
init(bool $auto_load = true)

Initializes the model

Parameters

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

in Model at line 311
load()

in Model at line 594
protected bool load_from_db(string $table_name, array|bool $key_fields = false)

Parameters

string $table_name Table Name
array|bool $key_fields Key fields which should be used as WHERE condition

Return Value

bool

in Model at line 826
ModelCollection|array populate_model_by_query(string $model_name, array|string $dbquery_result, string $population_mode = 'full', string $post_fill_function = 'update')

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|array empty array if none found and compatibility-mode on (xelos model_version < 1)

in Model at line 1213
protected array process_find_query(mixed $select_field, mixed $query_params)

Execute Query of find() function. Can be modified by child class if necessary

Parameters

mixed $select_field
mixed $query_params

Return Value

array dbquery Result

in Model at line 147
reload_schema()

Reloads the schema of the model

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

Parameters

string $table_name Table Name
array $key_fields Key fields which should be used as WHERE condition

Return Value

bool

in Model at line 1553
null render()

Generic Renderer

Return Value

null

in Model at line 288
save()

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

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 Model at line 1255
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

Search for passed search query in all passed fields, one match is enough

Parameters

string $query
array $field_list
mixed $query_params

Return Value

array

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

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 Model at line 425
set_property(string|array $property_id, string|bool $property_value = false, bool $no_change = false)

Set a Property. If $property_id is an array and $property_value is false, set_property is called for each element in the array with the array key and value as params.

Parameters

string|array $property_id Marker ID (Can also be an Array)
string|bool $property_value Value
bool $no_change Value return void

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

Sets parameter that will be passed to the XUI helpers

Parameters

mixed $params

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

Set Request Cache Entry

Parameters

string $key
mixed $value

in Model at line 713
sort_down(int $steps = 1, array $params = array())

Decrease Sort Priority (Increases SORT value)

Parameters

int $steps
array $params (e.g. filter, order_by)

in Model at line 703
sort_up(int $steps = 1, array $params = array())

Increase Sort Priority (Decreases SORT value)

Parameters

int $steps
array $params (e.g. filter, order_by)

in Model at line 1519
stop_temporary_group_id_overwrite()

Stops the temporary overwrite of the table_group_id

in Model at line 1494
temporarily_disable_table_group_id()

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

in Model at line 1511
temporarily_enable_table_group_id()

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

in Model at line 1434
string to_json()

Returns the model as JSON array

Return Value

string Returns model string

in Model at line 1445
string to_string()

Returns the model as STRING

Return Value

string Returns model as string

in Model at line 1387
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 727
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 Model at line 920
string|true validate(array $fieldErrors)

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