DatabaseRecord

Database record class

Table of Contents

Properties

$row  : array<string|int, mixed>|null
$table  : string
$uid  : int

Methods

__construct()  : mixed
create()  : DatabaseRecord
Creates database record object just by id of database record.
createFromArray()  : DatabaseRecord
Creates database record object by relevant database record row.
getIdentifier()  : string
Gets the record identifier (table:id).
getRow()  : array<string|int, mixed>
Gets the database record row.
getTable()  : string
Gets the name of the database table.
getUid()  : int
Gets the id of the database record row.
setRow()  : mixed
Sets the database record row.
setTable()  : mixed
Sets the name of the database table.
setUid()  : mixed
Sets the id of the database record row.
loadRow()  : void
Loads the database record row (if not available yet).

Properties

$row

protected array<string|int, mixed>|null $row

Methods

__construct()

public __construct(string $table, int $uid[, array<string|int, mixed>|null $row = null ]) : mixed
Parameters
$table : string

Name of the database table

$uid : int

Id of the database record row

$row : array<string|int, mixed>|null = null

The relevant database record row

create()

Creates database record object just by id of database record.

public static create(string $table, int $uid) : DatabaseRecord
Parameters
$table : string

Name of the database table

$uid : int

Id of the database record row

Return values
DatabaseRecord

createFromArray()

Creates database record object by relevant database record row.

public static createFromArray(string $table, array<string|int, mixed> $row) : DatabaseRecord
Parameters
$table : string

Name of the database table

$row : array<string|int, mixed>

The relevant database record row

Return values
DatabaseRecord

getIdentifier()

Gets the record identifier (table:id).

public getIdentifier() : string
Return values
string

getRow()

Gets the database record row.

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

getTable()

Gets the name of the database table.

public getTable() : string
Return values
string

getUid()

Gets the id of the database record row.

public getUid() : int
Return values
int

setRow()

Sets the database record row.

public setRow(array<string|int, mixed> $row) : mixed
Parameters
$row : array<string|int, mixed>

setTable()

Sets the name of the database table.

public setTable(string $table) : mixed
Parameters
$table : string

setUid()

Sets the id of the database record row.

public setUid(int $uid) : mixed
Parameters
$uid : int

loadRow()

Loads the database record row (if not available yet).

protected loadRow() : void

        
On this page

Search results