class Model (View source)

A class the defines that possible interactions with a database record.

Properties

protected Record $record

Methods

__construct(Record $record)

Model constructor.

static Model
createFromDatabaseRecord(Record $record)

Initializes the model with the given database record instead of calling the default constructor.

getDatabaseRecord()

Returns the database record for the model.

Details

protected __construct(Record $record)

Model constructor.

Parameters

Record $record The database record for the model

static Model createFromDatabaseRecord(Record $record)

Initializes the model with the given database record instead of calling the default constructor.

Parameters

Record $record The database record for the model

Return Value

Model A new initialized model with the given database record

Record getDatabaseRecord()

Returns the database record for the model.

Return Value

Record The database record for the model