CodeModel extends CodeModel
Class created by Core/Base/PluginManager
Table of Contents
$dataBase | It provides direct access to the database. | DataBase |
---|---|---|
$code | Value of the code field of the model read. | string |
$description | Value of the field description of the model read. | string |
__construct() | Constructor and class initializer. | mixed |
all() | Load a CodeModel list (code and description) for the indicated table. | static[] |
array2codeModel() | Convert an associative array (code and value) into a CodeModel array. | static[] |
search() | Load a CodeModel list (code and description) for the indicated table and search. | static[] |
get() | Returns a codemodel with the selected data. | static |
getDescription() | Returns a description with the selected data. | string |
initDataBase() | Inits database connection. | mixed |
Properties
$dataBase
It provides direct access to the database.
protected
static DataBase
$dataBase
$code
Value of the code field of the model read.
public
string
$code
$description
Value of the field description of the model read.
public
string
$description
Methods
__construct()
Constructor and class initializer.
public
__construct(
[ $data :
array
= [] ]
)
: mixed
Parameters
- $data : array = []
Return values
mixedall()
Load a CodeModel list (code and description) for the indicated table.
public
static all(
$tableName :
string
, $fieldCode :
string
, $fieldDescription :
string
[, $addEmpty :
bool
= true ]
[, $where :
array
= [] ]
)
: static[]
Parameters
- $tableName : string
- $fieldCode : string
- $fieldDescription : string
- $addEmpty : bool = true
- $where : array = []
Return values
static[]array2codeModel()
Convert an associative array (code and value) into a CodeModel array.
public
static array2codeModel(
$data :
array
[, $addEmpty :
bool
= true ]
)
: static[]
Parameters
- $data : array
- $addEmpty : bool = true
Return values
static[]search()
Load a CodeModel list (code and description) for the indicated table and search.
public
static search(
$tableName :
string
, $fieldCode :
string
, $fieldDescription :
string
, $query :
string
[, $where :
\FacturaScripts\Core\Base\DataBase\DataBaseWhere[]
= [] ]
)
: static[]
Parameters
- $tableName : string
- $fieldCode : string
- $fieldDescription : string
- $query : string
- $where : \FacturaScripts\Core\Base\DataBase\DataBaseWhere[] = []
Return values
static[]get()
Returns a codemodel with the selected data.
public
get(
$tableName :
string
, $fieldCode :
string
, $code :
string
, $fieldDescription :
string
)
: static
Parameters
- $tableName : string
- $fieldCode : string
- $code : string
- $fieldDescription : string
Return values
staticgetDescription()
Returns a description with the selected data.
public
getDescription(
$tableName :
string
, $fieldCode :
string
, $code :
string
, $fieldDescription :
string
)
: string
Parameters
- $tableName : string
- $fieldCode : string
- $code : string
- $fieldDescription : string
Return values
stringinitDataBase()
Inits database connection.
protected
static initDataBase(
)
: mixed