Model.php
system/Model.php
1 class
29 methods
class Model
The Model class extends BaseModel and provides additional convenient features that makes working with a SQL database table less painful. It will: - automatically connect to database - allow intermingling calls to the builder - removes the need to use Result object directly in most cases
__construct
(?ConnectionInterface $db = null, ?ValidationInterface $validation = null)
setTable
(string $table)
doFind
(bool $singleton, $id = null)
doFindColumn
(string $columnName)
doFindAll
(?int $limit = null, int $offset = 0)
doFirst
()
doInsert
(array $row)
doInsertBatch
(?array $set = null, ?bool $escape = null, int $batchSize = 100, bool $testing = false)
doUpdate
($id = null, $row = null)
doUpdateBatch
(?array $set = null, ?string $index = null, int $batchSize = 100, bool $returnSQL = false)
doDelete
($id = null, bool $purge = false)
doPurgeDeleted
()
doOnlyDeleted
()
doReplace
(?array $row = null, bool $returnSQL = false)
doErrors
()
getIdValue
($row)
chunk
(int $size, Closure $userFunc)
countAllResults
(bool $reset = true, bool $test = false)
builder
(?string $table = null)
set
($key, $value = '', ?bool $escape = null)
shouldUpdate
($row)
insert
($row = null, bool $returnID = true)
doProtectFieldsForInsert
(array $row)
update
($id = null, $row = null)
objectToRawArray
($object, bool $onlyChanged = true, bool $recursive = false)
__get
(string $name)
__isset
(string $name)
__call
(string $name, array $params)
checkBuilderMethod
(string $name)