abstract class Entity

Class Entity

Properties

DebugTool $debugTool The debug tool used.
string $shortName Class short name.
bool $exists
string $id
string $idField
string $nameField
array $newData
array $oldData

Methods

__construct()

Entity constructor.

string
getId()

Return the value of id.

string
getNameField()

Returns the name of the identification field of the record. By default it will be name.

$this
setData(array $data)

Assign newData from $data.

string
getIdField()

Returns the name of the main key field of the table (PK-Primary Key). By default it will be id.

array
getData()

Return newData details.

array
getOldData()

Return oldData details.

$this
setOldData(array $data)

Assign oldData from an array.

$this|mixed|null
__call(string $method, array $params)

Execute a magic method of the setField or getField style

mixed
__get(string $propertyName)

Magic getter.

$this
__set(string $propertyName, mixed $propertyValue)

Magic setter.

bool
__isset(string $propertyName)

Magic isset.

Details

at line 92
__construct()

Entity constructor.

at line 106
string getId()

Return the value of id.

Return Value

string

at line 116
string getNameField()

Returns the name of the identification field of the record. By default it will be name.

Return Value

string

at line 128
$this setData(array $data)

Assign newData from $data.

Parameters

array $data

Return Value

$this

at line 143
string getIdField()

Returns the name of the main key field of the table (PK-Primary Key). By default it will be id.

Return Value

string

at line 153
array getData()

Return newData details.

Return Value

array

at line 163
array getOldData()

Return oldData details.

Return Value

array

at line 175
$this setOldData(array $data)

Assign oldData from an array.

Parameters

array $data

Return Value

$this

at line 191
$this|mixed|null __call(string $method, array $params)

Execute a magic method of the setField or getField style

Parameters

string $method
array $params

Return Value

$this|mixed|null

Exceptions

RuntimeException

at line 220
mixed __get(string $propertyName)

Magic getter.

It allows access to a field of the record using the attribute. To access the name field, we should use $this->getName(), but thanks to this, we can also use $this->name.

Parameters

string $propertyName

Return Value

mixed

at line 236
$this __set(string $propertyName, mixed $propertyValue)

Magic setter.

Allows you to assign value to a field in the record using the attribute. To assign a value to the name field, we should use $this->setName('Pepe'), but thanks to this, we can also use $this->name='Pepe'.

Parameters

string $propertyName
mixed $propertyValue

Return Value

$this

at line 252
bool __isset(string $propertyName)

Magic isset.

Parameters

string $propertyName

Return Value

bool