PHP Class Services\Service

Mostra file Open project: openeyes/openeyes Class Usage Examples

Public Methods

Method Description
create ( Resource $resource ) : scalar Create a new resource and return its ID.
delete ( scalar $id ) Delete a resource by ID.
getLastModified ( scalar $id ) : integer Get the last modified date for a resource without fetching it.
load ( array $params = [] ) : Service
read ( scalar $id ) : resource Fetch a single resource by ID.
search ( array $params ) : resource[] Search for resources according to the parameters passed.
update ( scalar $id, Resource $resource ) Update a resource by ID.

Method Details

create() abstract public method

Create a new resource and return its ID.
abstract public create ( Resource $resource ) : scalar
$resource Resource
return scalar

delete() abstract public method

Delete a resource by ID.
abstract public delete ( scalar $id )
$id scalar

getLastModified() abstract public method

Get the last modified date for a resource without fetching it.
abstract public getLastModified ( scalar $id ) : integer
$id scalar
return integer

load() public static method

public static load ( array $params = [] ) : Service
$params array
return Service

read() abstract public method

Fetch a single resource by ID.
abstract public read ( scalar $id ) : resource
$id scalar
return resource

update() abstract public method

Update a resource by ID.
abstract public update ( scalar $id, Resource $resource )
$id scalar
$resource Resource