PHP Class Neos\Flow\Persistence\Generic\PersistenceManager

Inheritance: extends Neos\Flow\Persistence\AbstractPersistenceManager
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$addedObjects SplObjectStorage
$backend Neos\Flow\Persistence\Generic\Backend\BackendInterface
$changedObjects SplObjectStorage
$dataMapper DataMapper
$persistenceSession Session
$queryFactory Neos\Flow\Persistence\Generic\QueryFactoryInterface
$removedObjects SplObjectStorage

Méthodes publiques

Méthode Description
__construct ( ) Create new instance
add ( object $object ) : void Adds an object to the persistence.
clearState ( ) : void Clears the in-memory state of the persistence.
createQueryForType ( string $type ) : Neos\Flow\Persistence\QueryInterface Return a query object for the given type.
getIdentifierByObject ( object $object ) : mixed Returns the (internal) identifier for the object, if it is known to the backend. Otherwise NULL is returned.
getObjectByIdentifier ( mixed $identifier, string $objectType = null, boolean $useLazyLoading = false ) : object Returns the object with the (internal) identifier, if it is known to the backend. Otherwise NULL is returned.
getObjectCountByQuery ( Neos\Flow\Persistence\QueryInterface $query ) : integer Returns the number of records matching the query.
getObjectDataByIdentifier ( string $identifier, string $objectType = null ) : object Returns the object data for the (internal) identifier, if it is known to the backend. Otherwise FALSE is returned.
getObjectDataByQuery ( Neos\Flow\Persistence\QueryInterface $query ) : array Returns the object data matching the $query.
initialize ( ) : void Initializes the persistence manager
injectBackend ( Neos\Flow\Persistence\Generic\Backend\BackendInterface $backend ) : void Injects the backend to use
injectDataMapper ( DataMapper $dataMapper ) : void Injects the data mapper
injectPersistenceSession ( Session $persistenceSession ) : void Injects the persistence session
injectQueryFactory ( Neos\Flow\Persistence\Generic\QueryFactoryInterface $queryFactory ) : void Injects a QueryFactory instance
isConnected ( ) : boolean Returns TRUE, if an active connection to the persistence backend has been established, e.g. entities can be persisted.
isNewObject ( object $object ) : boolean Checks if the given object has ever been persisted.
persistAll ( boolean $onlyWhitelistedObjects = false ) : void Commits new objects and changes to objects in the current persistence session into the backend
remove ( object $object ) : void Removes an object to the persistence.
tearDown ( ) : void Tear down the persistence
update ( object $object ) : void Update an object in the persistence.

Méthodes protégées

Méthode Description
emitAllObjectsPersisted ( ) : void Signals that all persistAll() has been executed successfully.

Method Details

__construct() public méthode

Create new instance
public __construct ( )

add() public méthode

Adds an object to the persistence.
public add ( object $object ) : void
$object object The object to add
Résultat void

clearState() public méthode

Managed instances become detached, any fetches will return data directly from the persistence "backend". It will also forget about new objects.
public clearState ( ) : void
Résultat void

createQueryForType() public méthode

Return a query object for the given type.
public createQueryForType ( string $type ) : Neos\Flow\Persistence\QueryInterface
$type string
Résultat Neos\Flow\Persistence\QueryInterface

emitAllObjectsPersisted() protected méthode

Signals that all persistAll() has been executed successfully.
protected emitAllObjectsPersisted ( ) : void
Résultat void

getIdentifierByObject() public méthode

Note: this returns an identifier even if the object has not been persisted in case of AOP-managed entities. Use isNewObject() if you need to distinguish those cases.
public getIdentifierByObject ( object $object ) : mixed
$object object
Résultat mixed The identifier for the object if it is known, or NULL

getObjectByIdentifier() public méthode

Returns the object with the (internal) identifier, if it is known to the backend. Otherwise NULL is returned.
public getObjectByIdentifier ( mixed $identifier, string $objectType = null, boolean $useLazyLoading = false ) : object
$identifier mixed
$objectType string
$useLazyLoading boolean This option is ignored in this persistence manager
Résultat object The object for the identifier if it is known, or NULL

getObjectCountByQuery() public méthode

Returns the number of records matching the query.
public getObjectCountByQuery ( Neos\Flow\Persistence\QueryInterface $query ) : integer
$query Neos\Flow\Persistence\QueryInterface
Résultat integer

getObjectDataByIdentifier() public méthode

Returns the object data for the (internal) identifier, if it is known to the backend. Otherwise FALSE is returned.
public getObjectDataByIdentifier ( string $identifier, string $objectType = null ) : object
$identifier string
$objectType string
Résultat object The object data for the identifier if it is known, or FALSE

getObjectDataByQuery() public méthode

Returns the object data matching the $query.
public getObjectDataByQuery ( Neos\Flow\Persistence\QueryInterface $query ) : array
$query Neos\Flow\Persistence\QueryInterface
Résultat array

initialize() public méthode

Initializes the persistence manager
public initialize ( ) : void
Résultat void

injectBackend() public méthode

Injects the backend to use
public injectBackend ( Neos\Flow\Persistence\Generic\Backend\BackendInterface $backend ) : void
$backend Neos\Flow\Persistence\Generic\Backend\BackendInterface the backend to use for persistence
Résultat void

injectDataMapper() public méthode

Injects the data mapper
public injectDataMapper ( DataMapper $dataMapper ) : void
$dataMapper DataMapper
Résultat void

injectPersistenceSession() public méthode

Injects the persistence session
public injectPersistenceSession ( Session $persistenceSession ) : void
$persistenceSession Session The persistence session
Résultat void

injectQueryFactory() public méthode

Injects a QueryFactory instance
public injectQueryFactory ( Neos\Flow\Persistence\Generic\QueryFactoryInterface $queryFactory ) : void
$queryFactory Neos\Flow\Persistence\Generic\QueryFactoryInterface
Résultat void

isConnected() public méthode

Returns TRUE, if an active connection to the persistence backend has been established, e.g. entities can be persisted.
public isConnected ( ) : boolean
Résultat boolean TRUE, if an connection has been established, FALSE if add object will not be persisted by the backend

isNewObject() public méthode

Checks if the given object has ever been persisted.
public isNewObject ( object $object ) : boolean
$object object The object to check
Résultat boolean TRUE if the object is new, FALSE if the object exists in the persistence session

persistAll() public méthode

Commits new objects and changes to objects in the current persistence session into the backend
public persistAll ( boolean $onlyWhitelistedObjects = false ) : void
$onlyWhitelistedObjects boolean
Résultat void

remove() public méthode

Removes an object to the persistence.
public remove ( object $object ) : void
$object object The object to remove
Résultat void

tearDown() public méthode

This method is called in functional tests to reset the storage between tests. The implementation is optional and depends on the underlying persistence backend.
public tearDown ( ) : void
Résultat void

update() public méthode

Update an object in the persistence.
public update ( object $object ) : void
$object object The modified object
Résultat void

Property Details

$addedObjects protected_oe property

protected SplObjectStorage $addedObjects
Résultat SplObjectStorage

$backend protected_oe property

protected BackendInterface,Neos\Flow\Persistence\Generic\Backend $backend
Résultat Neos\Flow\Persistence\Generic\Backend\BackendInterface

$changedObjects protected_oe property

protected SplObjectStorage $changedObjects
Résultat SplObjectStorage

$dataMapper protected_oe property

protected DataMapper,Neos\Flow\Persistence\Generic $dataMapper
Résultat DataMapper

$persistenceSession protected_oe property

protected Session,Neos\Flow\Persistence\Generic $persistenceSession
Résultat Session

$queryFactory protected_oe property

protected QueryFactoryInterface,Neos\Flow\Persistence\Generic $queryFactory
Résultat Neos\Flow\Persistence\Generic\QueryFactoryInterface

$removedObjects protected_oe property

protected SplObjectStorage $removedObjects
Résultat SplObjectStorage