FacturaScripts

ModelTrait

The class from which all models inherit, connects to the database, check the structure of the table and if necessary create or adapt.

Tags
author

Carlos García Gómez carlos@facturascripts.com

Table of Contents

$fields  : array<string|int, mixed>
List of fields in the table.
getModelFields()  : array<string|int, mixed>
Returns the list of fields in the table.
modelClassName()  : string
Returns the name of the class of the model.
loadModelFields()  : void
Loads table fields if is necessary.
modelName()  : string
Returns the name of the model.

Properties

$fields

List of fields in the table.

protected static array<string|int, mixed> $fields = []

Methods

getModelFields()

Returns the list of fields in the table.

public getModelFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

modelClassName()

Returns the name of the class of the model.

public modelClassName() : string
Return values
string

loadModelFields()

Loads table fields if is necessary.

protected loadModelFields(DataBase &$dataBase, string $tableName) : void
Parameters
$dataBase : DataBase
$tableName : string
Return values
void

modelName()

Returns the name of the model.

protected modelName() : string
Return values
string

Search results