PHP Class Psecio\Gatekeeper\DataSource

Afficher le fichier Open project: psecio/gatekeeper Class Usage Examples

Méthodes publiques

Свойство Type Description
$config array Data source configuration options
$lastError string Last error from a datasource request

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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

count() abstract public méthode

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
Résultat boolean Success/fail of action

create() abstract public méthode

Create a new record with model given
abstract public create ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Résultat boolean Success/fail of action

delete() abstract public méthode

Delete the record defined by the model data
abstract public delete ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Résultat boolean Success/fail of action

find() abstract public méthode

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
Résultat object Either a collection or model instance

getConfig() public méthode

Get the configuration settings
public getConfig ( ) : array
Résultat array Config settings

getLastError() abstract public méthode

Return the last error from action taken on the datasource
abstract public getLastError ( ) : string
Résultat string Error string

save() abstract public méthode

Save the given model
abstract public save ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Résultat boolean Success/fail of action

setConfig() public méthode

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

update() abstract public méthode

Update the record for the given model
abstract public update ( Modler\Model $model ) : boolean
$model Modler\Model Model instance
Résultat boolean Success/fail of action

Property Details

$config public_oe property

Data source configuration options
public array $config
Résultat array

$lastError public_oe property

Last error from a datasource request
public string $lastError
Résultat string