PHP Класс Doctrine\ODM\CouchDB\UnitOfWork

С версии: 1.0
Автор: Benjamin Eberlei ([email protected])
Автор: Lukas Kahwe Smith ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( DocumentManager $dm )
computeChangeSet ( ClassMetadata $class, object $document ) : void
contains ( object $document ) : boolean
createDocument ( string $documentName, array $data, array &$hints = [] ) : object Create a document given class, data and the doc-id and revision
detach ( object $document ) Detaches a document from the persistence management. It's persistence will no longer be managed by Doctrine.
findMany ( array $ids, null | string $documentName = null, null | integer $limit = null, null | integer $offset = null ) : array Find many documents by id.
flush ( ) : void Flush Operation - Write all dirty entries to the CouchDB.
getDocumentIdentifier ( $document )
getDocumentRevision ( object $document ) : string Get the CouchDB revision of the document that was current upon retrieval.
getDocumentState ( object $document ) : integer Get the state of a document.
getIdentityMap ( ) : array Get all entries currently in the identity map
getOriginalData ( object $document ) : array
isInIdentityMap ( object $document ) : boolean Checks whether a document is registered in the identity map of this UnitOfWork.
merge ( $document )
persistNew ( ClassMetadata $class, object $document ) : void Persist new document, marking it managed and generating the id.
refresh ( $document )
registerManaged ( $document, $identifier, $revision )
removeFromIdentityMap ( object $document ) : boolean INTERNAL: Removes an document from the identity map. This effectively detaches the document from the persistence management of Doctrine.
scheduleInsert ( object $document ) Schedule insertion of this document and cascade if neccessary.
scheduleRemove ( $document )
tryGetById ( mixed $id ) : mixed Tries to find an document with the given identifier in the identity map of this UnitOfWork.

Приватные методы

Метод Описание
assertValidDocumentType ( $documentName, $document, $type )
cascadeDetach ( object $document, array &$visited ) Cascades a detach operation to associated documents.
cascadeMerge ( object $document, object $managedCopy, array &$visited ) Cascades a merge operation to associated entities.
cascadeRefresh ( $document, &$visited )
cascadeRemove ( $document, &$visited )
cascadeScheduleInsert ( ClassMetadata $class, object $document, array &$visited )
computeAssociationChanges ( array $assoc, mixed $value ) : InvalidArgumentException Computes the changes of an association.
createDocumentAttachments ( string $documentId, array $data ) : array
detectChangedDocuments ( )
doDetach ( object $document, array &$visited ) Executes a detach operation on the given entity.
doMerge ( $document, array &$visited, $prevManagedCopy = null, $assoc = null )
doRefresh ( $document, &$visited )
doRemove ( $document, &$visited )
doScheduleInsert ( $document, &$visited )
getIdGenerator ( $type )
objToStr ( $obj )

Описание методов

__construct() публичный Метод

public __construct ( DocumentManager $dm )
$dm DocumentManager

computeChangeSet() публичный Метод

public computeChangeSet ( ClassMetadata $class, object $document ) : void
$class Doctrine\ODM\CouchDB\Mapping\ClassMetadata
$document object
Результат void

contains() публичный Метод

public contains ( object $document ) : boolean
$document object
Результат boolean

createDocument() публичный Метод

Create a document given class, data and the doc-id and revision
public createDocument ( string $documentName, array $data, array &$hints = [] ) : object
$documentName string
$data array
$hints array
Результат object

detach() публичный Метод

Detaches a document from the persistence management. It's persistence will no longer be managed by Doctrine.
public detach ( object $document )
$document object The document to detach.

findMany() публичный Метод

Important: Each document is returned with the key it has in the $ids array!
public findMany ( array $ids, null | string $documentName = null, null | integer $limit = null, null | integer $offset = null ) : array
$ids array
$documentName null | string
$limit null | integer
$offset null | integer
Результат array

flush() публичный Метод

Flush Operation - Write all dirty entries to the CouchDB.
public flush ( ) : void
Результат void

getDocumentIdentifier() публичный Метод

public getDocumentIdentifier ( $document )

getDocumentRevision() публичный Метод

Get the CouchDB revision of the document that was current upon retrieval.
public getDocumentRevision ( object $document ) : string
$document object
Результат string

getDocumentState() публичный Метод

Get the state of a document.
public getDocumentState ( object $document ) : integer
$document object
Результат integer

getIdentityMap() публичный Метод

Get all entries currently in the identity map
public getIdentityMap ( ) : array
Результат array

getOriginalData() публичный Метод

public getOriginalData ( object $document ) : array
$document object
Результат array

isInIdentityMap() публичный Метод

Checks whether a document is registered in the identity map of this UnitOfWork.
public isInIdentityMap ( object $document ) : boolean
$document object
Результат boolean

merge() публичный Метод

public merge ( $document )

persistNew() публичный Метод

This method is either called through DocumentManager#persist() or during DocumentManager#flush(), when persistence by reachability is applied.
public persistNew ( ClassMetadata $class, object $document ) : void
$class Doctrine\ODM\CouchDB\Mapping\ClassMetadata
$document object
Результат void

refresh() публичный Метод

public refresh ( $document )

registerManaged() публичный Метод

public registerManaged ( $document, $identifier, $revision )

removeFromIdentityMap() публичный Метод

INTERNAL: Removes an document from the identity map. This effectively detaches the document from the persistence management of Doctrine.
public removeFromIdentityMap ( object $document ) : boolean
$document object
Результат boolean

scheduleInsert() публичный Метод

Schedule insertion of this document and cascade if neccessary.
public scheduleInsert ( object $document )
$document object

scheduleRemove() публичный Метод

public scheduleRemove ( $document )

tryGetById() публичный Метод

Tries to find an document with the given identifier in the identity map of this UnitOfWork.
public tryGetById ( mixed $id ) : mixed
$id mixed The document identifier to look for.
Результат mixed Returns the document with the specified identifier if it exists in this UnitOfWork, FALSE otherwise.