PHP Class ZF\Apigility\Model\MongoConnectedListener

Inheritance: extends ZF\Rest\AbstractResourceListener
Show file Open project: zfcampus/zf-apigility

Protected Properties

Property Type Description
$collection MongoCollection

Public Methods

Method Description
__construct ( MongoCollection $collection )
create ( array | object $data ) : array Create a new document in the MongoCollection
delete ( string $id ) : boolean Delete a document in a collection
fetch ( string $id ) : array | ZF\ApiProblem\ApiProblem Fetch data in a collection using the id
fetchAll ( array $params = [] ) : array Fetch all data in a collection
patch ( string $id, array $data ) : boolean Update of a document specified by id

Method Details

__construct() public method

public __construct ( MongoCollection $collection )
$collection MongoCollection

create() public method

Create a new document in the MongoCollection
public create ( array | object $data ) : array
$data array | object
return array

delete() public method

Delete a document in a collection
public delete ( string $id ) : boolean
$id string
return boolean

fetch() public method

Fetch data in a collection using the id
public fetch ( string $id ) : array | ZF\ApiProblem\ApiProblem
$id string
return array | ZF\ApiProblem\ApiProblem

fetchAll() public method

Fetch all data in a collection
public fetchAll ( array $params = [] ) : array
$params array
return array

patch() public method

Update of a document specified by id
public patch ( string $id, array $data ) : boolean
$id string
$data array
return boolean

Property Details

$collection protected property

protected MongoCollection $collection
return MongoCollection