PHP Class Services\ModelService

Inheritance: extends InternalService
Afficher le fichier Open project: openeyes/openeyes Class Usage Examples

Protected Properties

Свойство Type Description
$model
$operations Default set of operations for a model service, override if required.
$primary_model string The primary model class for this service.

Méthodes publiques

Méthode Description
__construct ( BaseActiveRecord $model )
create ( Resource $resource ) : integer
getLastModified ( integer $id ) : integer
load ( array $params = [] )
read ( integer $id ) : resource
update ( integer $id, Resource $resource )

Méthodes protégées

Méthode Description
getResourcesFromDataProvider ( CActiveDataProvider $provider ) : resource[] Get a list of resources from an AR data provider.
getSearchModel ( ) : BaseActiveRecord Get an instance of the model class to fill in with search details.
modelToResource ( BaseActiveRecord $model ) : resource
readModel ( integer $id ) : BaseActiveRecord
resourceToModel ( resource $resource, BaseActiveRecord $model )
saveModel ( BaseActiveRecord $model ) * Save model object and throw a service layer exception on failure

Method Details

__construct() public méthode

public __construct ( BaseActiveRecord $model )
$model BaseActiveRecord

create() public méthode

public create ( Resource $resource ) : integer
$resource Resource
Résultat integer

getLastModified() public méthode

public getLastModified ( integer $id ) : integer
$id integer
Résultat integer

getResourcesFromDataProvider() protected méthode

Get a list of resources from an AR data provider.
protected getResourcesFromDataProvider ( CActiveDataProvider $provider ) : resource[]
$provider CActiveDataProvider
Résultat resource[]

getSearchModel() protected méthode

Get an instance of the model class to fill in with search details.
protected getSearchModel ( ) : BaseActiveRecord
Résultat BaseActiveRecord

load() public static méthode

public static load ( array $params = [] )
$params array

modelToResource() protected méthode

protected modelToResource ( BaseActiveRecord $model ) : resource
$model BaseActiveRecord
Résultat resource

read() public méthode

public read ( integer $id ) : resource
$id integer
Résultat resource

readModel() protected méthode

protected readModel ( integer $id ) : BaseActiveRecord
$id integer
Résultat BaseActiveRecord

resourceToModel() protected méthode

protected resourceToModel ( resource $resource, BaseActiveRecord $model )
$resource resource
$model BaseActiveRecord

saveModel() protected méthode

* Save model object and throw a service layer exception on failure
protected saveModel ( BaseActiveRecord $model )
$model BaseActiveRecord

update() public méthode

public update ( integer $id, Resource $resource )
$id integer
$resource Resource

Property Details

$model protected_oe property

protected $model

$operations protected_oe static_oe property

Default set of operations for a model service, override if required.
protected static $operations

$primary_model protected_oe static_oe property

The primary model class for this service.
protected static string $primary_model
Résultat string