class DocumentManager implements ObjectManager (View source)

Methods

__construct(CouchDBClient $couchClient, Configuration $config = null, EventManager $evm = null)

No description

EventManager
getEventManager()

No description

CouchDBClient
getCouchDBClient()

No description

static DocumentManager
create(array|CouchDBClient $couchParams, Configuration $config = null, EventManager $evm = null)

Factory method for a Document Manager.

getProxyFactory()

No description

getHttpClient()

No description

getDatabase()

No description

getConfiguration()

No description

getClassMetadata(string $class)

No description

object
find(string $documentName, string $id)

Find the Document with the given id.

getRepository(string $documentName)

No description

createQuery(string $designDocName, string $viewName)

Create a Query for the view in the specified design document.

Query
createNativeQuery(string $designDocName, string $viewName)

Create a Native query for the view of the specified design document.

createLuceneQuery(string $designDocName, string $viewName)

Create a CouchDB-Lucene Query.

persist($object)

No description

remove($object)

No description

refresh(object $document)

Refresh the given document by querying the CouchDB to get the current state.

merge($document)

No description

detach($document)

No description

object
getReference(string $documentName, mixed $identifier)

Gets a reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded.

flush()

No description

bool
contains(object $document)

No description

getUnitOfWork()

No description

clear(string $objectName = null)

Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.

initializeObject(object $obj)

Initialize an object that is a lazy load proxy, or do nothing.

Details

__construct(CouchDBClient $couchClient, Configuration $config = null, EventManager $evm = null)

Parameters

CouchDBClient $couchClient
Configuration $config
EventManager $evm

EventManager getEventManager()

Return Value

EventManager

CouchDBClient getCouchDBClient()

Return Value

CouchDBClient

static DocumentManager create(array|CouchDBClient $couchParams, Configuration $config = null, EventManager $evm = null)

Factory method for a Document Manager.

Parameters

array|CouchDBClient $couchParams
Configuration $config
EventManager $evm

Return Value

DocumentManager

Exceptions

InvalidArgumentException

ClassMetadataFactory getMetadataFactory()

Return Value

ClassMetadataFactory

ProxyFactory getProxyFactory()

Return Value

ProxyFactory

getHttpClient()

getDatabase()

Configuration getConfiguration()

Return Value

Configuration

ClassMetadataFactory getClassMetadataFactory()

Return Value

ClassMetadataFactory

ClassMetadata getClassMetadata(string $class)

Parameters

string $class

Return Value

ClassMetadata

object find(string $documentName, string $id)

Find the Document with the given id.

Will return null if the document wasn't found.

Parameters

string $documentName
string $id

Return Value

object

DocumentRepository getRepository(string $documentName)

Parameters

string $documentName

Return Value

DocumentRepository

ODMQuery createQuery(string $designDocName, string $viewName)

Create a Query for the view in the specified design document.

Parameters

string $designDocName
string $viewName

Return Value

ODMQuery

Query createNativeQuery(string $designDocName, string $viewName)

Create a Native query for the view of the specified design document.

A native query will return an array of data from the &include_docs=true parameter.

Parameters

string $designDocName
string $viewName

Return Value

Query

ODMLuceneQuery createLuceneQuery(string $designDocName, string $viewName)

Create a CouchDB-Lucene Query.

Parameters

string $designDocName
string $viewName

Return Value

ODMLuceneQuery

persist($object)

Parameters

$object

remove($object)

Parameters

$object

refresh(object $document)

Refresh the given document by querying the CouchDB to get the current state.

Parameters

object $document

merge($document)

Parameters

$document

detach($document)

Parameters

$document

object getReference(string $documentName, mixed $identifier)

Gets a reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded.

Parameters

string $documentName The name of the entity type.
mixed $identifier The entity identifier.

Return Value

object The entity reference.

flush()

bool contains(object $document)

Parameters

object $document

Return Value

bool

UnitOfWork getUnitOfWork()

Return Value

UnitOfWork

clear(string $objectName = null)

Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.

Parameters

string $objectName if given, only objects of this type will get detached

Exceptions

CouchDBException

initializeObject(object $obj)

Initialize an object that is a lazy load proxy, or do nothing.

Parameters

object $obj