\ManaPHP\MvcModel

Summary

Methods
Properties
Constants
getDb()
connection()
getModelsMetadata()
getPrimaryKey()
getFields()
getIntFields()
getNextAutoIncrementId()
newQuery()
create()
update()
insertBySql()
deleteBySql()
updateBySql()
insert()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getDb()

getDb() : string

Gets the connection used to crud data to the model

Returns

string

connection()

connection(mixed  $context = null) : \ManaPHP\Data\DbInterface

Parameters

mixed $context

=get_object_vars(new static)

Returns

\ManaPHP\Data\DbInterface

getPrimaryKey()

getPrimaryKey() : string

Returns

string —

=key(get_object_vars(new static))

getFields()

getFields() : array

Returns

array —

=get_object_vars(new static)

getIntFields()

getIntFields() : array

Returns

array —

=get_object_vars(new static)

getNextAutoIncrementId()

getNextAutoIncrementId(integer  $step = 1) : integer

Parameters

integer $step

Returns

integer

create()

create() : static

Inserts a model instance. If the instance already exists in the persistence it will throw an exception

Returns

static

update()

update() : static

Updates a model instance. If the instance does n't exist in the persistence it will throw an exception

Returns

static

insertBySql()

insertBySql(array|string  $sql) : integer

Parameters

array|string $sql

Returns

integer

deleteBySql()

deleteBySql(array|string  $sql) : integer

Parameters

array|string $sql

Returns

integer

updateBySql()

updateBySql(array|string  $sql) : integer

Parameters

array|string $sql

Returns

integer

insert()

insert(array  $record) : integer

Parameters

array $record

=get_object_vars(new static)

Returns

integer