trait DatabaseRepositoryTrait (View source)

The DatabaseRepositoryTrait class.

Traits

The DatabaseModelTrait class.

Methods

void
bootDatabaseModelTrait(ModelRepository $model)

bootDatabaseModelTrait

AbstractDatabaseDriver
getDb()

getDb

setDb(AbstractDatabaseDriver $db)

setDb

transactionStart(boolean $nested = true)

transactionStart

transactionCommit(boolean $nested = true)

transactionCommit

transactionRollback(boolean $nested = true)

transactionRollback

void
bootModelRepositoryTrait()

bootModelRepositoryTrait

Record
getRecord(string $name = null)

getRecord

DataMapper
getDataMapper(string $name = null)

getDataMapper

string
getTableName()

getTableName

array|string
getKeyName(bool $multiple = false)

getKeyName

Details

void bootDatabaseModelTrait(ModelRepository $model)

bootDatabaseModelTrait

Parameters

ModelRepository $model

Return Value

void

AbstractDatabaseDriver getDb()

getDb

Return Value

AbstractDatabaseDriver

DatabaseModelTrait setDb(AbstractDatabaseDriver $db)

setDb

Parameters

AbstractDatabaseDriver $db

Return Value

DatabaseModelTrait Return self to support chaining.

DatabaseModelTrait transactionStart(boolean $nested = true)

transactionStart

Parameters

boolean $nested

Return Value

DatabaseModelTrait

DatabaseModelTrait transactionCommit(boolean $nested = true)

transactionCommit

Parameters

boolean $nested

Return Value

DatabaseModelTrait

DatabaseModelTrait transactionRollback(boolean $nested = true)

transactionRollback

Parameters

boolean $nested

Return Value

DatabaseModelTrait

at line line 34
void bootModelRepositoryTrait()

bootModelRepositoryTrait

Return Value

void

at line line 50
Record getRecord(string $name = null)

getRecord

Parameters

string $name

Return Value

Record

Exceptions

LogicException

at line line 119
DataMapper getDataMapper(string $name = null)

getDataMapper

Parameters

string $name

Return Value

DataMapper

Exceptions

LogicException

at line line 178
string getTableName()

getTableName

Return Value

string

at line line 192
array|string getKeyName(bool $multiple = false)

getKeyName

Parameters

bool $multiple

Return Value

array|string

Exceptions

LogicException