PHP Класс Psecio\Gatekeeper\DataSource

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$config array Data source configuration options
$lastError string Last error from a datasource request

Открытые методы

Метод Описание
__construct ( array $config ) Init the object and set the configuration
count ( Modler\Model $model, array $where = [] ) : boolean Return the number of entities in DB per condition or in general
create ( Modler\Model $model ) : boolean Create a new record with model given
delete ( Modler\Model $model ) : boolean Delete the record defined by the model data
find ( Modler\Model $model, array $where = [] ) : object Find and populate a model based on the model type and where criteria
getConfig ( ) : array Get the configuration settings
getLastError ( ) : string Return the last error from action taken on the datasource
save ( Modler\Model $model ) : boolean Save the given model
setConfig ( array $config ) Set the configuration
update ( Modler\Model $model ) : boolean Update the record for the given model

Описание методов

__construct() публичный Метод

Init the object and set the configuration
public __construct ( array $config )
$config array Configuration settings

count() абстрактный публичный Метод

Return the number of entities in DB per condition or in general
abstract public count ( Modler\Model $model, array $where = [] ) : boolean
$model Modler\Model Model instance
$where array
Результат boolean Success/fail of action

create() абстрактный публичный Метод

Create a new record with model given
abstract public create ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Результат boolean Success/fail of action

delete() абстрактный публичный Метод

Delete the record defined by the model data
abstract public delete ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Результат boolean Success/fail of action

find() абстрактный публичный Метод

Find and populate a model based on the model type and where criteria
abstract public find ( Modler\Model $model, array $where = [] ) : object
$model Modler\Model Model instance
$where array "Where" data to locate record
Результат object Either a collection or model instance

getConfig() публичный Метод

Get the configuration settings
public getConfig ( ) : array
Результат array Config settings

getLastError() абстрактный публичный Метод

Return the last error from action taken on the datasource
abstract public getLastError ( ) : string
Результат string Error string

save() абстрактный публичный Метод

Save the given model
abstract public save ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Результат boolean Success/fail of action

setConfig() публичный Метод

Set the configuration
public setConfig ( array $config )
$config array Config settings

update() абстрактный публичный Метод

Update the record for the given model
abstract public update ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Результат boolean Success/fail of action

Описание свойств

$config публичное свойство

Data source configuration options
public array $config
Результат array

$lastError публичное свойство

Last error from a datasource request
public string $lastError
Результат string