PHP Класс Neos\Flow\Persistence\Generic\PersistenceManager

Наследование: extends Neos\Flow\Persistence\AbstractPersistenceManager
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$addedObjects SplObjectStorage
$backend Neos\Flow\Persistence\Generic\Backend\BackendInterface
$changedObjects SplObjectStorage
$dataMapper DataMapper
$persistenceSession Session
$queryFactory Neos\Flow\Persistence\Generic\QueryFactoryInterface
$removedObjects SplObjectStorage

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

Метод Описание
__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.

Защищенные методы

Метод Описание
emitAllObjectsPersisted ( ) : void Signals that all persistAll() has been executed successfully.

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

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

Create new instance
public __construct ( )

add() публичный метод

Adds an object to the persistence.
public add ( object $object ) : void
$object object The object to add
Результат void

clearState() публичный метод

Managed instances become detached, any fetches will return data directly from the persistence "backend". It will also forget about new objects.
public clearState ( ) : void
Результат void

createQueryForType() публичный метод

Return a query object for the given type.
public createQueryForType ( string $type ) : Neos\Flow\Persistence\QueryInterface
$type string
Результат Neos\Flow\Persistence\QueryInterface

emitAllObjectsPersisted() защищенный метод

Signals that all persistAll() has been executed successfully.
protected emitAllObjectsPersisted ( ) : void
Результат void

getIdentifierByObject() публичный метод

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
Результат mixed The identifier for the object if it is known, or NULL

getObjectByIdentifier() публичный метод

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
Результат object The object for the identifier if it is known, or NULL

getObjectCountByQuery() публичный метод

Returns the number of records matching the query.
public getObjectCountByQuery ( Neos\Flow\Persistence\QueryInterface $query ) : integer
$query Neos\Flow\Persistence\QueryInterface
Результат integer

getObjectDataByIdentifier() публичный метод

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
Результат object The object data for the identifier if it is known, or FALSE

getObjectDataByQuery() публичный метод

Returns the object data matching the $query.
public getObjectDataByQuery ( Neos\Flow\Persistence\QueryInterface $query ) : array
$query Neos\Flow\Persistence\QueryInterface
Результат array

initialize() публичный метод

Initializes the persistence manager
public initialize ( ) : void
Результат void

injectBackend() публичный метод

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
Результат void

injectDataMapper() публичный метод

Injects the data mapper
public injectDataMapper ( DataMapper $dataMapper ) : void
$dataMapper DataMapper
Результат void

injectPersistenceSession() публичный метод

Injects the persistence session
public injectPersistenceSession ( Session $persistenceSession ) : void
$persistenceSession Session The persistence session
Результат void

injectQueryFactory() публичный метод

Injects a QueryFactory instance
public injectQueryFactory ( Neos\Flow\Persistence\Generic\QueryFactoryInterface $queryFactory ) : void
$queryFactory Neos\Flow\Persistence\Generic\QueryFactoryInterface
Результат void

isConnected() публичный метод

Returns TRUE, if an active connection to the persistence backend has been established, e.g. entities can be persisted.
public isConnected ( ) : boolean
Результат boolean TRUE, if an connection has been established, FALSE if add object will not be persisted by the backend

isNewObject() публичный метод

Checks if the given object has ever been persisted.
public isNewObject ( object $object ) : boolean
$object object The object to check
Результат boolean TRUE if the object is new, FALSE if the object exists in the persistence session

persistAll() публичный метод

Commits new objects and changes to objects in the current persistence session into the backend
public persistAll ( boolean $onlyWhitelistedObjects = false ) : void
$onlyWhitelistedObjects boolean
Результат void

remove() публичный метод

Removes an object to the persistence.
public remove ( object $object ) : void
$object object The object to remove
Результат void

tearDown() публичный метод

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
Результат void

update() публичный метод

Update an object in the persistence.
public update ( object $object ) : void
$object object The modified object
Результат void

Описание свойств

$addedObjects защищенное свойство

protected SplObjectStorage $addedObjects
Результат SplObjectStorage

$backend защищенное свойство

protected BackendInterface,Neos\Flow\Persistence\Generic\Backend $backend
Результат Neos\Flow\Persistence\Generic\Backend\BackendInterface

$changedObjects защищенное свойство

protected SplObjectStorage $changedObjects
Результат SplObjectStorage

$dataMapper защищенное свойство

protected DataMapper,Neos\Flow\Persistence\Generic $dataMapper
Результат DataMapper

$persistenceSession защищенное свойство

protected Session,Neos\Flow\Persistence\Generic $persistenceSession
Результат Session

$queryFactory защищенное свойство

protected QueryFactoryInterface,Neos\Flow\Persistence\Generic $queryFactory
Результат Neos\Flow\Persistence\Generic\QueryFactoryInterface

$removedObjects защищенное свойство

protected SplObjectStorage $removedObjects
Результат SplObjectStorage