Documentation

CharacterNPCModel extends CharacterModel
in package

Tags
addtogroup

models Group of Models

@{

Table of Contents

Constants

_APPLICATION_NAME  = "Magna Regula"
_AVATAR_FILENAME  = 'avatar_image'
_AVATAR_THUMBNAIL  = 'avatar_thumbnail'
_FIRST_ATTSKL_INDEX  = 8
_LASTGENERATED_FILENAME  = "last_generated.html"
_SEVERITY_KO  = 2
_SEVERITY_OK  = 0
_SEVERITY_TEXT  = array(\BaseModel::_SEVERITY_OK => 'OK', \BaseModel::_SEVERITY_WARN => 'WARNING', \BaseModel::_SEVERITY_KO => 'KO')
_SEVERITY_WARN  = 1
_TEXT_CODESET  = "UTF-8"
_TEXT_DOMAIN  = "magnaregula"
API_TOKEN_INVALID  = 895
API_TOKEN_NOT_ACTIVE  = 897
API_TOKEN_NOT_FOUND  = 896
API_TOKEN_TOO_OLD  = 899
API_TOKEN_TOO_YOUNG  = 898
DEFAULT_STATIC_FILES_REPOSITORY_URL  = 'DEFAULT_STATIC_FILES_REPOSITORY_URL'
DEFAULT_TINYMCE_EDITOR_CHARACTER_CSS_PATH  = "/css/tinymce_editor_character.css"
DEFAULT_TINYMCE_EDITOR_SCENARIO_CSS_PATH  = "/css/tinymce_editor_scenario.css"
FULL_POINTS_JSON  = 'FULL_POINTS_JSON'
MAIN_3DANIM_IMAGE  = 'MAIN_3DANIM_IMAGE'
MAIN_3DVIEW_IMAGE  = 'MAIN_3DVIEW_IMAGE'
MAIN_3DVIEW_MAP_IMAGE  = 'MAIN_3DVIEW_MAP_IMAGE'
MAIN_OVER_COLLIDER_IMAGE  = 'MAIN_OVER_COLLIDER_IMAGE'
MAIN_OVER_MAP_IMAGE  = 'MAIN_OVER_MAP_IMAGE'
MESH_PREFAB_ASSETBUNDLE  = 'MESH_PREFAB_ASSETBUNDLE'
NODEJS_GENERATE_PDF_CHARACTER_URL  = 'NODEJS_GENERATE_PDF_CHARACTER_URL'
NODEJS_GENERATE_PDF_SCENARIO_URL  = 'NODEJS_GENERATE_PDF_SCENARIO_URL'
ORIGINAL_OVER_MAP_IMAGE  = 'ORIGINAL_OVER_MAP_IMAGE'
PDF_GEN_RETURNS_STRUCT  = \TRUE
PRINT_DEFAULT_FONT_FAMILY  = "Georgia"
PRINT_DEFAULT_FONT_SIZE  = "10pt"
PRINT_DEFAULT_FORMAT  = "A4"
SSB_CODE_ASSETOBJECTS  = "S3-ASSETOBJECTS"
SSB_CODE_CHARACTERS  = "S3-CHARACTERS"
SSB_CODE_SCENARIOS  = "S3-SCENARIOS"
SSB_CODE_TILEOBJECTS  = "S3-TILEOBJECTS"
VALUE_IS_INT  = 2
VALUE_IS_UUID  = 1
WATABOU_GENERATION_LOG  = 'WATABOU_GENERATION_LOG'
WEBSERVICES_ROOT_URL  = 'WEBSERVICES_ROOT_URL'

Properties

$_chr_params_fields_to_extract  : mixed
$_class_model  : mixed
$_control_owner  : mixed
$_default_character_json_settings  : mixed
$_default_print_formats  : mixed
$_default_print_formats0  : mixed
$_default_scenario_json_settings  : mixed
$_files_repositories_codes  : mixed
$_INFOS_JEXCEL  : mixed
$_list_fields_to_localize  : mixed
$_objectName  : mixed
$_race_model  : mixed
$_rul_params_fields_to_extract  : mixed
$_rule_model  : mixed
$_sql_load_by_uuid  : mixed
$_sql_search_cht_row  : mixed
$_sql_search_pdt_row  : mixed
$_sql_search_rgm_row  : mixed
$_sql_search_tmi_row  : mixed
$_sql_select_token  : mixed
$_sql_select_with_textfield  : mixed
$_tableLOCALEKEYCode  : mixed
$_tableMainCode  : mixed
$_tableName  : mixed
$_tablePrefix  : mixed
$_token_id  : mixed
$_alternative_keys_for_localize  : mixed
$_dbconn_read  : mixed
$_dbconn_write  : mixed
$_delete_locale  : mixed
$_errormessages  : mixed
$_sql_check_maincode  : mixed
$_sql_delete  : mixed
$_sql_inserts  : mixed
$_sql_list  : mixed
$_sql_list_all  : mixed
$_sql_list_locales  : mixed
$_sql_load  : mixed
$_sql_load_by_key  : mixed
$_sql_translate  : mixed
$_sql_updates  : mixed
$_update_locale  : mixed
$_with_block_for_localize  : mixed
$_dbconnection_read  : mixed
$_dbconnection_write  : mixed

Methods

__()  : mixed
__construct()  : mixed
__destruct()  : mixed
_add_last_slash_if_not()  : mixed
_add_localised_fields()  : mixed
_affect_mainattributes_with_profile()  : mixed
_affect_mainattributes_with_profile_by_allocation()  : mixed
_affect_mainattributes_with_profile_by_allocation0()  : mixed
_affect_mainattributes_with_profile_by_allocation_pass_1()  : mixed
_affect_mainattributes_with_profile_by_allocation_pass_2()  : mixed
_append_to_file_static()  : mixed
_bind_params()  : mixed
_bindtextdomain()  : mixed
_build_array_for_prepare()  : mixed
_build_array_formulaattributes()  : mixed
_build_array_mainattributes()  : mixed
_build_array_mainskills()  : mixed
_build_block()  : string
Returns a block of text, with variables, replaced
_build_block_dollar()  : mixed
_build_block_generic()  : mixed
_build_error_message()  : mixed
_build_fields_list_when_localizedkeys()  : mixed
_build_json_settings()  : mixed
_call_ws()  : mixed
Calls a webservice
_check_fields_for_delete()  : mixed
_check_fields_for_insert()  : mixed
_check_fields_for_update()  : mixed
_check_fields_for_update_post_load()  : none
Allows to complete $fields array, with informations stored in current row (row BEFORE update) Different from '_check_fields_for_update', because '_check_fields_for_update' fires BEFORE load BEFORE update.
_check_maincode_for_insert()  : mixed
_check_maincode_for_update()  : mixed
_check_validation_controls()  : mixed
_clone()  : mixed
_clone_character()  : mixed
_clone_chr_in_different_rules()  : mixed
_clone_chr_in_same_rules()  : mixed
_complete_fields_to_load()  : mixed
_compute_costs()  : mixed
_connect_for_read()  : object
Returns a pointer to PDO object instance, for read operations on database Memorizes it in $this->_dbconn_read
_connect_for_write()  : object
Returns a pointer to PDO object instance, for write operations on database Memorizes it in $this->_dbconn_write
_count_missingattributes()  : mixed
_count_missingskills()  : mixed
_create_default_character_repository()  : mixed
_db_query()  : array<string|int, mixed>
Perform a read query (SELECT) on database
_db_query_range()  : array<string|int, mixed>
Perform a limited (offset+limit) read query (SELECT) on database
_delete()  : mixed
_delete_locale()  : mixed
_disconnect_for_read()  : none
Clear the pointer to PDO object read instance
_disconnect_for_write()  : none
Clear the pointer to PDO object write instance
_escape_single_quote_for_db()  : mixed
_extract_extension()  : mixed
_extract_values_from_field_to_extract()  : mixed
_filter_skills()  : mixed
_find_array_key_by_value()  : mixed
_find_characterstatus()  : mixed
_generate_character_pdf_infos()  : mixed
_get_character_avatar_link()  : mixed
_get_errormessage()  : mixed
_insert()  : mixed
_insert_default_rule()  : mixed
_insert_rule_attributes()  : mixed
_is_int_or_uuid()  : mixed
_is_owner_of()  : mixed
_is_token_valid()  : mixed
_load_all_infos()  : mixed
_load_models()  : mixed
_normalize_fields()  : mixed
_normalize_int()  : mixed
_only_alphanum()  : mixed
_perform_other_action_after_delete()  : mixed
_perform_other_action_after_insert()  : mixed
_perform_other_action_after_update()  : mixed
_prepare_return_after_update()  : mixed
_prepare_sql_for_update()  : mixed
_recompute_storage()  : mixed
_search_print_format_by_locale()  : mixed
_set_sql_list()  : mixed
_switch_text_to_locale()  : mixed
_translate_output()  : mixed
_translate_output0()  : mixed
_translate_pdf_block()  : mixed
_translate_text()  : string
Translate a text, by calling __()
_update()  : array<string|int, mixed>
Perform an UPDATE
_update_chr_params()  : mixed
_update_formulaattributes()  : mixed
_update_formulaskills()  : mixed
_update_locale()  : mixed
_update_mainattributes()  : mixed
_update_rule_attributes()  : mixed
affect_rolls()  : mixed
att_bonus()  : mixed
avatar_infos()  : mixed
change_counter()  : mixed
change_skillrank()  : mixed
clone_from_jexcel()  : mixed
clone_one_character()  : mixed
delete_url()  : mixed
DELETE a webservice
extend_formula()  : mixed
generate_characters()  : mixed
generate_one_character()  : mixed
generate_pdf()  : mixed
get_sql_delete()  : mixed
get_sql_inserts()  : mixed
get_sql_list_locales()  : mixed
get_sql_translate()  : mixed
get_sql_updates()  : mixed
get_text_generic()  : mixed
get_url()  : mixed
GET a webservice
getGUID()  : mixed
getGUIDv2()  : mixed
list_in_account()  : mixed
list_in_parent()  : mixed
list_locales()  : mixed
list_suggestedtags()  : mixed
load()  : mixed
load_by_key()  : mixed
post_url()  : mixed
POST a webservice
put_url()  : mixed
PUT a webservice
query_by_id()  : array<string|int, mixed>
Perform a query to lookup ONE DB instance, based on its main key (integer)
query_by_key()  : array<string|int, mixed>
Perform a query to lookup ONE DB instance, based on its main key (string/integer)
recompute_attributes_and_skills()  : mixed
remove_avatar()  : mixed
set_alignment()  : mixed
simple_load()  : mixed
suggest_tags()  : mixed
tblist()  : mixed
tblist_all()  : mixed
templateillustrations()  : mixed
unaffect_rolls()  : mixed
update_from_jexcel()  : mixed
update_tags()  : mixed
upload_avatar()  : mixed

Constants

_APPLICATION_NAME

public mixed _APPLICATION_NAME = "Magna Regula"

_SEVERITY_TEXT

public mixed _SEVERITY_TEXT = array(\BaseModel::_SEVERITY_OK => 'OK', \BaseModel::_SEVERITY_WARN => 'WARNING', \BaseModel::_SEVERITY_KO => 'KO')

_SEVERITY_WARN

public mixed _SEVERITY_WARN = 1

_TEXT_CODESET

public mixed _TEXT_CODESET = "UTF-8"

_TEXT_DOMAIN

public mixed _TEXT_DOMAIN = "magnaregula"

API_TOKEN_INVALID

public mixed API_TOKEN_INVALID = 895

API_TOKEN_NOT_ACTIVE

public mixed API_TOKEN_NOT_ACTIVE = 897

API_TOKEN_NOT_FOUND

public mixed API_TOKEN_NOT_FOUND = 896

API_TOKEN_TOO_OLD

public mixed API_TOKEN_TOO_OLD = 899

API_TOKEN_TOO_YOUNG

public mixed API_TOKEN_TOO_YOUNG = 898

DEFAULT_STATIC_FILES_REPOSITORY_URL

public mixed DEFAULT_STATIC_FILES_REPOSITORY_URL = 'DEFAULT_STATIC_FILES_REPOSITORY_URL'

DEFAULT_TINYMCE_EDITOR_CHARACTER_CSS_PATH

public mixed DEFAULT_TINYMCE_EDITOR_CHARACTER_CSS_PATH = "/css/tinymce_editor_character.css"

DEFAULT_TINYMCE_EDITOR_SCENARIO_CSS_PATH

public mixed DEFAULT_TINYMCE_EDITOR_SCENARIO_CSS_PATH = "/css/tinymce_editor_scenario.css"

MAIN_3DVIEW_MAP_IMAGE

public mixed MAIN_3DVIEW_MAP_IMAGE = 'MAIN_3DVIEW_MAP_IMAGE'

MAIN_OVER_COLLIDER_IMAGE

public mixed MAIN_OVER_COLLIDER_IMAGE = 'MAIN_OVER_COLLIDER_IMAGE'

MAIN_OVER_MAP_IMAGE

public mixed MAIN_OVER_MAP_IMAGE = 'MAIN_OVER_MAP_IMAGE'

MESH_PREFAB_ASSETBUNDLE

public mixed MESH_PREFAB_ASSETBUNDLE = 'MESH_PREFAB_ASSETBUNDLE'

NODEJS_GENERATE_PDF_CHARACTER_URL

public mixed NODEJS_GENERATE_PDF_CHARACTER_URL = 'NODEJS_GENERATE_PDF_CHARACTER_URL'

NODEJS_GENERATE_PDF_SCENARIO_URL

public mixed NODEJS_GENERATE_PDF_SCENARIO_URL = 'NODEJS_GENERATE_PDF_SCENARIO_URL'

ORIGINAL_OVER_MAP_IMAGE

public mixed ORIGINAL_OVER_MAP_IMAGE = 'ORIGINAL_OVER_MAP_IMAGE'

PDF_GEN_RETURNS_STRUCT

public mixed PDF_GEN_RETURNS_STRUCT = \TRUE

PRINT_DEFAULT_FONT_FAMILY

public mixed PRINT_DEFAULT_FONT_FAMILY = "Georgia"

SSB_CODE_ASSETOBJECTS

public mixed SSB_CODE_ASSETOBJECTS = "S3-ASSETOBJECTS"

SSB_CODE_TILEOBJECTS

public mixed SSB_CODE_TILEOBJECTS = "S3-TILEOBJECTS"

WATABOU_GENERATION_LOG

public mixed WATABOU_GENERATION_LOG = 'WATABOU_GENERATION_LOG'

WEBSERVICES_ROOT_URL

public mixed WEBSERVICES_ROOT_URL = 'WEBSERVICES_ROOT_URL'

Properties

$_chr_params_fields_to_extract

public mixed $_chr_params_fields_to_extract = array()

$_default_character_json_settings

public static mixed $_default_character_json_settings = array('print' => array('format' => \NULL, 'font' => \NULL, 'size' => \NULL))

$_default_print_formats

public static mixed $_default_print_formats = array('format_type' => array('A4' => array('locale' => 'fr', 'value' => 'A4', 'value_puppeteer' => 'A4', 'width' => '21cm', 'height' => '29.7cm', 'margin_vertical' => '1.5cm', 'margin_horizontal' => '1.5cm'), 'US Letter' => array('locale' => 'en', 'value' => 'Letter', 'value_puppeteer' => 'letter', 'width' => '8.5in', 'height' => '11in', 'margin_vertical' => '1.5cm', 'margin_horizontal' => '1.5cm')), 'font_family' => array('Georgia' => array('value' => 'Georgia, Times New Roman, serif'), 'Arial' => array('value' => 'Arial, sans-serif')), 'font_size' => array('10pt' => array('value' => '10pt'), '12pt' => array('value' => '12pt')))

$_default_print_formats0

public static mixed $_default_print_formats0 = array('format_type' => array('A4' => array('locale' => 'fr'), 'US Letter' => array('locale' => 'en')), 'font_family' => array('Georgia' => array('name' => 'Georgia', 'value' => 'Georgia, Times New Roman, serif'), 'Arial' => array('name' => 'Arial', 'value' => 'Arial, sans-serif')), 'font_size' => array('10pt' => array('name' => '10pt', 'value' => '10pt'), '12pt' => array('name' => '12pt', 'value' => '12pt')))

$_default_scenario_json_settings

public static mixed $_default_scenario_json_settings = array('print' => array('format' => \NULL, 'font' => \NULL, 'size' => \NULL))

$_files_repositories_codes

public static mixed $_files_repositories_codes = array("assetobject" => array("url" => "ASSETOBJECT_REPOSITORY_URL_ROOT", "file" => "ASSETOBJECT_REPOSITORY_FILE_ROOT"), "tileobject" => array("url" => "TILEOBJECT_REPOSITORY_URL_ROOT", "file" => "TILEOBJECT_REPOSITORY_FILE_ROOT"))

$_INFOS_JEXCEL

public mixed $_INFOS_JEXCEL = array('chr_pk', 'xxx_order', 'delete', 'clone', 'order', 'chr_pseudo')

$_list_fields_to_localize

public mixed $_list_fields_to_localize = \NULL

$_rul_params_fields_to_extract

public mixed $_rul_params_fields_to_extract = array('rul_method1_name', 'rul_method2_name', 'rul_method3_name', 'rul_method2_att_dice_formula_text', 'rul_method3_att_dice_formula_text')

$_sql_load_by_uuid

public static mixed $_sql_load_by_uuid = <<<EOT SELECT A.chr_pk AS _pk, A.chr_pk FROM character A WHERE A.chr_uuid = :chr_uuid EOT

$_sql_search_cht_row

public static mixed $_sql_search_cht_row = "SELECT A.* FROM charactertype A WHERE A.cht_pk=:cht_pk"

$_sql_search_pdt_row

public static mixed $_sql_search_pdt_row = "SELECT MAX(A.pdt_pk) AS pdt_pk FROM pdt_rul A INNER JOIN pdftemplate B ON B.pdt_pk=A.pdt_pk INNER JOIN pdftemplatetype C ON B.ptt_pk=C.ptt_pk WHERE A.rul_pk=:rul_pk AND A.pdt_default_for_rule = TRUE AND C.ptt_for_character = TRUE"

$_sql_search_rgm_row

public static mixed $_sql_search_rgm_row = "SELECT A.rgm_method_number FROM rulegenerationmethod A WHERE rul_pk=:rul_pk AND rgm_active=TRUE AND rgm_usuable_by_pc = TRUE"

$_sql_search_tmi_row

public static mixed $_sql_search_tmi_row = "SELECT MAX(A.tmi_pk) AS tmi_pk FROM templateillustration A INNER JOIN pdftemplatetype C ON A.ptt_pk=C.ptt_pk WHERE A.rul_pk=:rul_pk AND A.tmi_default = TRUE AND C.ptt_for_character = TRUE"

$_sql_select_with_textfield

public static mixed $_sql_select_with_textfield = <<<EOT SELECT A.chr_pk AS _pk, A.chr_pk, A.chr_pseudo, A.%s FROM character A WHERE A.chr_pk=:_pk EOT

$_alternative_keys_for_localize

protected mixed $_alternative_keys_for_localize = \NULL

$_errormessages

protected static mixed $_errormessages = array(100 => 'Error in execute()', 101 => 'Error on _insert(). Code already exists', 102 => 'Error on _update(). Code already exists in other row', 201 => 'Error on _insert(). Code is empty', 202 => 'Error on _update(). Code is empty', 311 => 'Error on _insert(). Email not valid', 312 => 'Error on _insert(). Password not defined', 313 => 'Error on _update(). Passwords are different', 314 => 'Error on _update(). Password must be 5 characters or more', 315 => 'Error on _update(). Value must be between MIN and MAX values', 895 => 'No API token or API token invalid', 896 => 'API token not found', 897 => 'API token not active', 898 => 'API token invalid (too young)', self::API_TOKEN_TOO_OLD => 'API token invalid (too old)')

$_with_block_for_localize

protected mixed $_with_block_for_localize = \TRUE

$_dbconnection_read

private mixed $_dbconnection_read = array('db' => 'pgsql:host=' . \DbModel::DB_HOST . ';port=5433;dbname=magnaregula;', 'user' => 'magnaregula', 'password' => 'qnty2573')

$_dbconnection_write

private mixed $_dbconnection_write = array('db' => 'pgsql:host=' . \DbModel::DB_HOST . ';port=5433;dbname=magnaregula;', 'user' => 'magnaregula', 'password' => 'qnty2573')

Methods

__()

public static __(mixed $text) : mixed
Parameters
$text : mixed

__construct()

public __construct([mixed $token_id = NULL ]) : mixed
Parameters
$token_id : mixed = NULL

_add_last_slash_if_not()

public static _add_last_slash_if_not(mixed $string) : mixed
Parameters
$string : mixed

_add_localised_fields()

public _add_localised_fields(mixed &$row) : mixed
Parameters
$row : mixed

_affect_mainattributes_with_profile()

public _affect_mainattributes_with_profile(mixed $_pk, mixed $row, mixed $row_chp, mixed $r) : mixed
Parameters
$_pk : mixed
$row : mixed
$row_chp : mixed
$r : mixed

_affect_mainattributes_with_profile_by_allocation()

public _affect_mainattributes_with_profile_by_allocation(mixed $_pk, mixed $row, mixed $row_chp, mixed $r, mixed $rowsCHPATT) : mixed
Parameters
$_pk : mixed
$row : mixed
$row_chp : mixed
$r : mixed
$rowsCHPATT : mixed

_affect_mainattributes_with_profile_by_allocation0()

public _affect_mainattributes_with_profile_by_allocation0(mixed $_pk, mixed $row_chp, mixed $r) : mixed
Parameters
$_pk : mixed
$row_chp : mixed
$r : mixed

_affect_mainattributes_with_profile_by_allocation_pass_1()

public _affect_mainattributes_with_profile_by_allocation_pass_1(mixed $_pk, mixed $row, mixed $row_chp, mixed $r, mixed $rowsCHPATT[, mixed $initial_cost = 0 ]) : mixed
Parameters
$_pk : mixed
$row : mixed
$row_chp : mixed
$r : mixed
$rowsCHPATT : mixed
$initial_cost : mixed = 0

_affect_mainattributes_with_profile_by_allocation_pass_2()

public _affect_mainattributes_with_profile_by_allocation_pass_2(mixed $_pk, mixed $row, mixed $row_chp, mixed $r, mixed $rowsCHPATT[, mixed $initial_cost = 0 ]) : mixed
Parameters
$_pk : mixed
$row : mixed
$row_chp : mixed
$r : mixed
$rowsCHPATT : mixed
$initial_cost : mixed = 0

_append_to_file_static()

public static _append_to_file_static(mixed $text) : mixed
Parameters
$text : mixed

_bind_params()

public _bind_params(mixed &$pdostatement, mixed &$params, mixed $sql) : mixed
Parameters
$pdostatement : mixed
$params : mixed
$sql : mixed

_bindtextdomain()

public static _bindtextdomain([mixed $domain = self::_TEXT_DOMAIN ]) : mixed
Parameters
$domain : mixed = self::_TEXT_DOMAIN

_build_array_for_prepare()

public _build_array_for_prepare(mixed $array, mixed $sql[, mixed $action = NULL ]) : mixed
Parameters
$array : mixed
$sql : mixed
$action : mixed = NULL

_build_array_formulaattributes()

public _build_array_formulaattributes([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_build_array_mainattributes()

public _build_array_mainattributes([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_build_array_mainskills()

public _build_array_mainskills([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_build_block()

Returns a block of text, with variables, replaced

public _build_block(mixed $blocktext, mixed $row[, mixed $clearvars = TRUE ]) : string
Parameters
$blocktext : mixed

Text to update

$row : mixed

An associated array of variables

$clearvars : mixed = TRUE

If variables still stay in text, replace them by '' (or not)

Return values
string

The $text, updated

_build_block_dollar()

public _build_block_dollar(mixed $blocktext, mixed $row[, mixed $clearvars = TRUE ]) : mixed
Parameters
$blocktext : mixed
$row : mixed
$clearvars : mixed = TRUE

_build_block_generic()

public static _build_block_generic(mixed $blocktext, mixed $row[, mixed $clearvars = TRUE ][, mixed $marker = '%' ]) : mixed
Parameters
$blocktext : mixed
$row : mixed
$clearvars : mixed = TRUE
$marker : mixed = '%'

_build_error_message()

public _build_error_message(mixed $errorcode) : mixed
Parameters
$errorcode : mixed

_build_fields_list_when_localizedkeys()

public _build_fields_list_when_localizedkeys(mixed &$fields) : mixed
Parameters
$fields : mixed

_call_ws()

Calls a webservice

public static _call_ws(string $url, string $method, array<string|int, mixed> $fields) : mixed
Parameters
$url : string

The FQDN url to call

$method : string

GET, POST, PUT, DELETE

$fields : array<string|int, mixed>

Array of values (for PUT and POST, for instance)

Tags
since

Unknown

access

public

used-by

getAction()

used-by

putAction()

used-by

postAction()

used-by

deleteAction()

uses
curl_init()
uses
http_build_query()
uses
curl_setopt()
uses
curl_exec()
Return values
mixed

The result of curl_exec()

_check_fields_for_delete()

public _check_fields_for_delete(mixed $_pk, mixed &$fields) : mixed
Parameters
$_pk : mixed
$fields : mixed

_check_fields_for_insert()

public _check_fields_for_insert(mixed $action, mixed &$fields) : mixed
Parameters
$action : mixed
$fields : mixed

_check_fields_for_update()

public _check_fields_for_update(mixed $_pk, mixed $action, mixed &$fields) : mixed
Parameters
$_pk : mixed
$action : mixed
$fields : mixed

_check_fields_for_update_post_load()

Allows to complete $fields array, with informations stored in current row (row BEFORE update) Different from '_check_fields_for_update', because '_check_fields_for_update' fires BEFORE load BEFORE update.

public _check_fields_for_update_post_load(int $_pk, string $action, array<string|int, mixed> &$fields, array<string|int, mixed> $row) : none

Also different from '_check_fields_for_update', because there is NO RETURN.

Parameters
$_pk : int

The main key

$action : string

The action code

$fields : array<string|int, mixed>

The fields which could be altered

$row : array<string|int, mixed>

The current row, obtained by self::load()

Tags
since

Unknown

Return values
none

_check_maincode_for_insert()

public _check_maincode_for_insert(mixed $value, mixed &$fields) : mixed
Parameters
$value : mixed
$fields : mixed

_check_maincode_for_update()

public _check_maincode_for_update(mixed $_pk, mixed $value, mixed &$fields) : mixed
Parameters
$_pk : mixed
$value : mixed
$fields : mixed

_check_validation_controls()

public _check_validation_controls(mixed $id, mixed $row) : mixed
Parameters
$id : mixed
$row : mixed

_clone()

public _clone(mixed $_pk[, mixed $fields = NULL ]) : mixed
Parameters
$_pk : mixed
$fields : mixed = NULL

_clone_character()

public _clone_character(mixed $row_chr, mixed $rul_pk_to, mixed $sce_pk_to) : mixed
Parameters
$row_chr : mixed
$rul_pk_to : mixed
$sce_pk_to : mixed

_clone_chr_in_different_rules()

public _clone_chr_in_different_rules(mixed $row_chr, mixed $rul_pk_to, mixed $sce_pk_to) : mixed
Parameters
$row_chr : mixed
$rul_pk_to : mixed
$sce_pk_to : mixed

_clone_chr_in_same_rules()

public _clone_chr_in_same_rules(mixed $row_chr, mixed $rul_pk_to, mixed $sce_pk_to) : mixed
Parameters
$row_chr : mixed
$rul_pk_to : mixed
$sce_pk_to : mixed

_complete_fields_to_load()

public _complete_fields_to_load(mixed $id, mixed &$ret) : mixed
Parameters
$id : mixed
$ret : mixed

_connect_for_read()

Returns a pointer to PDO object instance, for read operations on database Memorizes it in $this->_dbconn_read

public _connect_for_read() : object
Tags
since

Unknown

Return values
object

A PDO object

_connect_for_write()

Returns a pointer to PDO object instance, for write operations on database Memorizes it in $this->_dbconn_write

public _connect_for_write() : object
Tags
since

Unknown

Return values
object

A PDO object

_count_missingattributes()

public _count_missingattributes([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_count_missingskills()

public _count_missingskills([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_create_default_character_repository()

public _create_default_character_repository(mixed $chr_uuid) : mixed
Parameters
$chr_uuid : mixed

_db_query()

Perform a read query (SELECT) on database

public _db_query(string $sql[, int $fetchmode = PDO::FETCH_OBJ ]) : array<string|int, mixed>
Parameters
$sql : string

Text of SQL query

$fetchmode : int = PDO::FETCH_OBJ

structure to return (array or object)

Tags
since

Unknown

see
DbModel::_connect_for_read()
Return values
array<string|int, mixed>

The rows, else FALSE

_db_query_range()

Perform a limited (offset+limit) read query (SELECT) on database

public _db_query_range(string $sql, int $offset, int $limit) : array<string|int, mixed>
Parameters
$sql : string

Text of SQL query

$offset : int

Begins query to this offset

$limit : int

The max number of rows to return

Tags
since

Unknown

see
self::_connect_for_read()
Return values
array<string|int, mixed>

The rows, else FALSE

_delete()

public _delete(mixed $_pk[, mixed $fields = NULL ]) : mixed
Parameters
$_pk : mixed
$fields : mixed = NULL

_delete_locale()

public _delete_locale(mixed $old_code) : mixed
Parameters
$old_code : mixed

_disconnect_for_read()

Clear the pointer to PDO object read instance

public _disconnect_for_read() : none
Tags
since

Unknown

Return values
none

_disconnect_for_write()

Clear the pointer to PDO object write instance

public _disconnect_for_write() : none
Tags
since

Unknown

Return values
none

_escape_single_quote_for_db()

public static _escape_single_quote_for_db(mixed $string) : mixed
Parameters
$string : mixed

_extract_extension()

public static _extract_extension(mixed $filename) : mixed
Parameters
$filename : mixed

_extract_values_from_field_to_extract()

public _extract_values_from_field_to_extract(mixed $chr_params, mixed $field, mixed &$ret) : mixed
Parameters
$chr_params : mixed
$field : mixed
$ret : mixed

_filter_skills()

public _filter_skills(mixed $skills, mixed $property) : mixed
Parameters
$skills : mixed
$property : mixed

_find_array_key_by_value()

public static _find_array_key_by_value(mixed $array, mixed $value, mixed $key_field, mixed $value_field) : mixed
Parameters
$array : mixed
$value : mixed
$key_field : mixed
$value_field : mixed

_find_characterstatus()

public _find_characterstatus([mixed $can_play = FALSE ][, mixed $in_creation = FALSE ]) : mixed
Parameters
$can_play : mixed = FALSE
$in_creation : mixed = FALSE

_generate_character_pdf_infos()

public _generate_character_pdf_infos(mixed $chr_pk[, mixed $embedded = FALSE ]) : mixed
Parameters
$chr_pk : mixed
$embedded : mixed = FALSE
public static _get_character_avatar_link(mixed $filename[, mixed $signed = TRUE ]) : mixed
Parameters
$filename : mixed
$signed : mixed = TRUE

_get_errormessage()

public static _get_errormessage(mixed $error) : mixed
Parameters
$error : mixed

_insert()

public _insert([mixed $action = 'insert' ][, mixed $fields = NULL ]) : mixed
Parameters
$action : mixed = 'insert'
$fields : mixed = NULL
Tags
see
MagnaRegulaModel::_insert()
see
MagnaRegulaModel::_load()
see
_update()
see
_insert_rule_attributes()
see
_update_formulaattributes()
see
_update_formulaskills()

_insert_default_rule()

public _insert_default_rule(mixed $id, mixed &$row) : mixed
Parameters
$id : mixed
$row : mixed

_insert_rule_attributes()

public _insert_rule_attributes(mixed $id, mixed &$row) : mixed
Parameters
$id : mixed
$row : mixed

_is_int_or_uuid()

public static _is_int_or_uuid(mixed $value) : mixed
Parameters
$value : mixed

_is_owner_of()

public _is_owner_of(mixed $acc_pk) : mixed
Parameters
$acc_pk : mixed

_is_token_valid()

public _is_token_valid(mixed $id) : mixed
Parameters
$id : mixed

_load_all_infos()

public _load_all_infos([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_load_models()

public _load_models(mixed $id, mixed $row) : mixed
Parameters
$id : mixed
$row : mixed

_normalize_fields()

public _normalize_fields(mixed &$fields) : mixed
Parameters
$fields : mixed

_normalize_int()

public _normalize_int(mixed $parm) : mixed
Parameters
$parm : mixed

_only_alphanum()

public static _only_alphanum(mixed $string) : mixed
Parameters
$string : mixed

_perform_other_action_after_delete()

public _perform_other_action_after_delete(mixed $row_deleted, mixed $action, mixed $return, mixed $params) : mixed
Parameters
$row_deleted : mixed
$action : mixed
$return : mixed
$params : mixed

_perform_other_action_after_insert()

public _perform_other_action_after_insert(mixed $action, mixed $return, mixed $params[, mixed $original_fields = NULL ]) : mixed
Parameters
$action : mixed
$return : mixed
$params : mixed
$original_fields : mixed = NULL

_perform_other_action_after_update()

public _perform_other_action_after_update(mixed $row_updated, mixed $action, mixed $return, mixed $params) : mixed
Parameters
$row_updated : mixed
$action : mixed
$return : mixed
$params : mixed

_prepare_return_after_update()

public _prepare_return_after_update(mixed $action, mixed $return, mixed $fields) : mixed
Parameters
$action : mixed
$return : mixed
$fields : mixed

_prepare_sql_for_update()

public _prepare_sql_for_update(mixed $action, mixed $sql, mixed $fields) : mixed
Parameters
$action : mixed
$sql : mixed
$fields : mixed

_recompute_storage()

public _recompute_storage(mixed $row_chr) : mixed
Parameters
$row_chr : mixed

_search_print_format_by_locale()

public _search_print_format_by_locale(mixed $locale) : mixed
Parameters
$locale : mixed

_set_sql_list()

public _set_sql_list(mixed $sql) : mixed
Parameters
$sql : mixed

_switch_text_to_locale()

public static _switch_text_to_locale(mixed $locale) : mixed
Parameters
$locale : mixed

_translate_output()

public _translate_output(mixed $result[, mixed $locale = 'en' ][, mixed $request = NULL ][, mixed $marker = '' ][, mixed $cache_context = NULL ]) : mixed
Parameters
$result : mixed
$locale : mixed = 'en'
$request : mixed = NULL
$marker : mixed = ''
$cache_context : mixed = NULL

_translate_output0()

public _translate_output0(mixed $result[, mixed $locale = 'en' ][, mixed $request = NULL ][, mixed $marker = '' ][, mixed $cache_context = NULL ]) : mixed
Parameters
$result : mixed
$locale : mixed = 'en'
$request : mixed = NULL
$marker : mixed = ''
$cache_context : mixed = NULL

_translate_pdf_block()

public static _translate_pdf_block(mixed $block, mixed $locale[, mixed $domain = self::_TEXT_DOMAIN ][, mixed $domain_primary = TRUE ]) : mixed
Parameters
$block : mixed
$locale : mixed
$domain : mixed = self::_TEXT_DOMAIN
$domain_primary : mixed = TRUE

_translate_text()

Translate a text, by calling __()

public static _translate_text(string $text[, string $linuxlocale = NULL ]) : string
Parameters
$text : string

Text to translate

$linuxlocale : string = NULL

the function setlocale needs this parameter

Tags
since

Unknown

access

public

uses
setlocale()
uses
bindtextdomain()
uses
textdomain()
uses
BaseModel::__()
Return values
string

The $text translated

_update()

Perform an UPDATE

public _update(mixed $_pk[, mixed $action = 'update' ][, mixed $fields = NULL ]) : array<string|int, mixed>
Parameters
$_pk : mixed

The primary key

$action : mixed = 'update'

The action to perform ('update' in most cases)

$fields : mixed = NULL

Fields corresponding to column values

Tags
see
_check_fields_for_update()
see
MagnaRegulaModel::load()
see
RuleModel::change_creationmethod()
see
_update()
see
_update_formulaattributes()
see
_update_formulaskills()
Return values
array<string|int, mixed>

An array containing error+rows

_update_chr_params()

public _update_chr_params(mixed $chr_pk, mixed $chr_params[, mixed $TRACE = '' ]) : mixed
Parameters
$chr_pk : mixed
$chr_params : mixed
$TRACE : mixed = ''

_update_formulaattributes()

public _update_formulaattributes([mixed $id = NULL ][, mixed $withSkills = FALSE ]) : mixed
Parameters
$id : mixed = NULL
$withSkills : mixed = FALSE

_update_formulaskills()

public _update_formulaskills([mixed $id = NULL ]) : mixed
Parameters
$id : mixed = NULL

_update_locale()

public _update_locale(mixed $old_code, mixed $new_code) : mixed
Parameters
$old_code : mixed
$new_code : mixed

_update_mainattributes()

public _update_mainattributes([mixed $id = NULL ][, mixed $rulemodel = NULL ]) : mixed
Parameters
$id : mixed = NULL
$rulemodel : mixed = NULL

_update_rule_attributes()

public _update_rule_attributes(mixed $id, mixed &$row) : mixed
Parameters
$id : mixed
$row : mixed

att_bonus()

public att_bonus(mixed $_pk, mixed $fields) : mixed
Parameters
$_pk : mixed
$fields : mixed

avatar_infos()

public avatar_infos(mixed $_pk[, mixed $actions = NULL ]) : mixed
Parameters
$_pk : mixed
$actions : mixed = NULL

change_skillrank()

public change_skillrank(mixed $_pk, mixed $fields) : mixed
Parameters
$_pk : mixed
$fields : mixed

clone_from_jexcel()

public clone_from_jexcel(mixed $character_jexcel) : mixed
Parameters
$character_jexcel : mixed

clone_one_character()

public clone_one_character(mixed $rank, mixed $acc_pk, mixed $row_chp[, mixed $params = array() ]) : mixed
Parameters
$rank : mixed
$acc_pk : mixed
$row_chp : mixed
$params : mixed = array()

delete_url()

DELETE a webservice

public static delete_url(string $url, array<string|int, mixed> $fields) : mixed
Parameters
$url : string

The FQDN url to call

$fields : array<string|int, mixed>

Array of values (for PUT and POST, for instance)

Tags
since

Unknown

access

public

uses
self::_call_ws()
Return values
mixed

The result of curl_exec()

extend_formula()

public static extend_formula(mixed &$formula, mixed $rulemodel[, mixed $chr_pk = 0 ]) : mixed
Parameters
$formula : mixed
$rulemodel : mixed
$chr_pk : mixed = 0

generate_characters()

public generate_characters(mixed $acc_pk, mixed $row_chp[, mixed $params = array() ]) : mixed
Parameters
$acc_pk : mixed
$row_chp : mixed
$params : mixed = array()

generate_one_character()

public generate_one_character(mixed $rank, mixed $acc_pk, mixed $row_chp[, mixed $params = array() ]) : mixed
Parameters
$rank : mixed
$acc_pk : mixed
$row_chp : mixed
$params : mixed = array()

generate_pdf()

public generate_pdf(mixed $chr_pk, mixed $parameters, mixed $request) : mixed
Parameters
$chr_pk : mixed
$parameters : mixed
$request : mixed

get_text_generic()

public static get_text_generic(mixed $chr_pk, mixed $fieldname) : mixed
Parameters
$chr_pk : mixed
$fieldname : mixed

get_url()

GET a webservice

public static get_url(string $url, array<string|int, mixed> $fields) : mixed
Parameters
$url : string

The FQDN url to call

$fields : array<string|int, mixed>

Array of values (for PUT and POST, for instance)

Tags
since

Unknown

access

public

uses
self::_call_ws()
Return values
mixed

The result of curl_exec()

getGUIDv2()

public static getGUIDv2() : mixed

list_in_account()

public list_in_account(mixed $_pk[, mixed $fetchmode = PDO::FETCH_ASSOC ]) : mixed
Parameters
$_pk : mixed
$fetchmode : mixed = PDO::FETCH_ASSOC

list_in_parent()

public list_in_parent(mixed $_pk[, mixed $fetchmode = PDO::FETCH_ASSOC ]) : mixed
Parameters
$_pk : mixed
$fetchmode : mixed = PDO::FETCH_ASSOC

list_locales()

public list_locales([mixed $tableMainCode = NULL ][, mixed $row = NULL ][, mixed $fields_to_localize = array() ]) : mixed
Parameters
$tableMainCode : mixed = NULL
$row : mixed = NULL
$fields_to_localize : mixed = array()

list_suggestedtags()

public list_suggestedtags(mixed $key[, mixed $request = NULL ]) : mixed
Parameters
$key : mixed
$request : mixed = NULL

load()

public load(mixed $id[, mixed $control_owner = TRUE ]) : mixed
Parameters
$id : mixed
$control_owner : mixed = TRUE

load_by_key()

public load_by_key(mixed $id) : mixed
Parameters
$id : mixed

post_url()

POST a webservice

public static post_url(string $url, array<string|int, mixed> $fields) : mixed
Parameters
$url : string

The FQDN url to call

$fields : array<string|int, mixed>

Array of values (for PUT and POST, for instance)

Tags
since

Unknown

access

public

uses
self::_call_ws()
Return values
mixed

The result of curl_exec()

put_url()

PUT a webservice

public static put_url(string $url, array<string|int, mixed> $fields) : mixed
Parameters
$url : string

The FQDN url to call

$fields : array<string|int, mixed>

Array of values (for PUT and POST, for instance)

Tags
since

Unknown

access

public

uses
self::_call_ws()
Return values
mixed

The result of curl_exec()

query_by_id()

Perform a query to lookup ONE DB instance, based on its main key (integer)

public query_by_id(string $query, int $id[, bool $fetch = TRUE ]) : array<string|int, mixed>
Parameters
$query : string

The SELECT statement, with an '%d' for main key

$id : int

The main key to find

$fetch : bool = TRUE

Returns an ASSOC array, or not

Tags
since

Unknown

see
DbModel::_connect_for_read()
see
::_normalize_int()
see
::_add_localised_fields()
Return values
array<string|int, mixed>

An array, with error+message+row

query_by_key()

Perform a query to lookup ONE DB instance, based on its main key (string/integer)

public query_by_key(string $query, mixed $id[, bool $fetch = TRUE ]) : array<string|int, mixed>
Parameters
$query : string

The SELECT statement, with an '%d' or ''%s' for main key

$id : mixed

The main key to find

$fetch : bool = TRUE

Returns an ASSOC array, or not

Tags
since

Unknown

see
self::_connect_for_read()
see
self::_normalize_int()
see
self::_add_localised_fields()
Return values
array<string|int, mixed>

An array, with error+message+row

recompute_attributes_and_skills()

public recompute_attributes_and_skills([mixed $chr_pk = NULL ]) : mixed
Parameters
$chr_pk : mixed = NULL

remove_avatar()

public remove_avatar(mixed &$fields, mixed $row) : mixed
Parameters
$fields : mixed
$row : mixed

set_alignment()

public set_alignment(mixed $_pk, mixed $fields) : mixed
Parameters
$_pk : mixed
$fields : mixed

simple_load()

public simple_load(mixed $id[, mixed $control_owner = TRUE ]) : mixed
Parameters
$id : mixed
$control_owner : mixed = TRUE

suggest_tags()

public suggest_tags(mixed $chr_pk, mixed $elements[, mixed $parameters = NULL ][, mixed $request = NULL ]) : mixed
Parameters
$chr_pk : mixed
$elements : mixed
$parameters : mixed = NULL
$request : mixed = NULL

tblist()

public tblist(mixed $url_elements[, mixed $fetchmode = PDO::FETCH_ASSOC ]) : mixed
Parameters
$url_elements : mixed
$fetchmode : mixed = PDO::FETCH_ASSOC

tblist_all()

public tblist_all([mixed $fetchmode = PDO::FETCH_ASSOC ]) : mixed
Parameters
$fetchmode : mixed = PDO::FETCH_ASSOC

templateillustrations()

public templateillustrations(mixed $_pk[, mixed $actions = NULL ]) : mixed
Parameters
$_pk : mixed
$actions : mixed = NULL

update_from_jexcel()

public update_from_jexcel(mixed $character_jexcel[, mixed $rows_scg = array() ]) : mixed
Parameters
$character_jexcel : mixed
$rows_scg : mixed = array()

upload_avatar()

public upload_avatar(mixed &$fields, mixed $row) : mixed
Parameters
$fields : mixed
$row : mixed

        
On this page

Search results