BaseModel
extends stdClass
in package
Table of Contents
Constants
- _APPLICATION_NAME = "Magna Regula"
- _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
Properties
- $_errormessages : mixed
Methods
- __() : mixed
- __construct() : mixed
- _add_last_slash_if_not() : mixed
- _append_to_file_static() : mixed
- _bindtextdomain() : mixed
- _build_block() : string
- Returns a block of text, with variables, replaced
- _extract_extension() : mixed
- _get_errormessage() : mixed
- _switch_text_to_locale() : mixed
- _translate_text() : string
- Translate a text, by calling __()
- getGUID() : mixed
- getGUIDv2() : mixed
Constants
_APPLICATION_NAME
public
mixed
_APPLICATION_NAME
= "Magna Regula"
_SEVERITY_KO
public
mixed
_SEVERITY_KO
= 2
_SEVERITY_OK
public
mixed
_SEVERITY_OK
= 0
_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
Properties
$_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)')
Methods
__()
public
static __(mixed $text) : mixed
Parameters
- $text : mixed
__construct()
public
__construct() : mixed
_add_last_slash_if_not()
public
static _add_last_slash_if_not(mixed $string) : mixed
Parameters
- $string : mixed
_append_to_file_static()
public
static _append_to_file_static(mixed $text) : mixed
Parameters
- $text : mixed
_bindtextdomain()
public
static _bindtextdomain([mixed $domain = self::_TEXT_DOMAIN ]) : mixed
Parameters
- $domain : mixed = self::_TEXT_DOMAIN
_build_block()
Returns a block of text, with variables, replaced
public
_build_block(string $blocktext, array<string|int, mixed> $row[, bool $clearvars = TRUE ]) : string
Parameters
- $blocktext : string
-
Text to update
- $row : array<string|int, mixed>
-
An associated array of variables
- $clearvars : bool = TRUE
-
If variables still stay in text, replace them by '' (or not)
Tags
Return values
string —The $text, updated
_extract_extension()
public
static _extract_extension(mixed $filename) : mixed
Parameters
- $filename : mixed
_get_errormessage()
public
static _get_errormessage(mixed $error) : mixed
Parameters
- $error : mixed
_switch_text_to_locale()
public
static _switch_text_to_locale(mixed $locale) : mixed
Parameters
- $locale : mixed
_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
Return values
string —The $text translated
getGUID()
public
static getGUID() : mixed
getGUIDv2()
public
static getGUIDv2() : mixed