PHP Class Neos\Flow\Persistence\Doctrine\PersistenceManager

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

Protected Properties

Свойство Type Description
$entityManager Doctrine\Common\Persistence\ObjectManager
$reflectionService Neos\Flow\Reflection\ReflectionService
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$validatorResolver Neos\Flow\Validation\ValidatorResolver

Méthodes publiques

Méthode Description
add ( object $object ) : void Adds an object to the persistence.
clearState ( ) : void Clears the in-memory state of the persistence.
compile ( ) : boolean Called from functional tests, creates/updates database tables and compiles proxies.
createQueryForType ( string $type ) : Query 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.
hasUnpersistedChanges ( ) : boolean Gives feedback if the persistence Manager has unpersisted changes.
initializeObject ( ) : void Initializes the persistence manager, called by Flow.
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.
onFlush ( Doctrine\ORM\Event\OnFlushEventArgs $eventArgs ) : void An onFlush event listener used to validate entities upon persistence.
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 Called after a functional test in Flow, dumps everything in the database.
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.
validateObject ( object $object, SplObjectStorage $validatedInstancesContainer ) : void Validates the given object and throws an exception if validation fails.

Method Details

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".
public clearState ( ) : void
Résultat void

compile() public méthode

Called from functional tests, creates/updates database tables and compiles proxies.
public compile ( ) : boolean
Résultat boolean

createQueryForType() public méthode

Return a query object for the given type.
public createQueryForType ( string $type ) : Query
$type string
Résultat Query

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 Set to TRUE if you want to use lazy loading for this object
Résultat object The object for the identifier if it is known, or NULL

hasUnpersistedChanges() public méthode

This is primarily used to inform the user if he tries to save data in an unsafe request.
public hasUnpersistedChanges ( ) : boolean
Résultat boolean

initializeObject() public méthode

Initializes the persistence manager, called by Flow.
public initializeObject ( ) : void
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 repository

onFlush() public méthode

An onFlush event listener used to validate entities upon persistence.
public onFlush ( Doctrine\ORM\Event\OnFlushEventArgs $eventArgs ) : void
$eventArgs Doctrine\ORM\Event\OnFlushEventArgs
Résultat void

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 If TRUE an exception will be thrown if there are scheduled updates/deletes or insertions for objects that are not "whitelisted" (see AbstractPersistenceManager::whitelistObject())
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

Called after a functional test in Flow, dumps everything in the database.
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

validateObject() protected méthode

Validates the given object and throws an exception if validation fails.
protected validateObject ( object $object, SplObjectStorage $validatedInstancesContainer ) : void
$object object
$validatedInstancesContainer SplObjectStorage
Résultat void

Property Details

$entityManager protected_oe property

protected ObjectManager,Doctrine\Common\Persistence $entityManager
Résultat Doctrine\Common\Persistence\ObjectManager

$reflectionService protected_oe property

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Résultat Neos\Flow\Reflection\ReflectionService

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Résultat Neos\Flow\Log\SystemLoggerInterface

$validatorResolver protected_oe property

protected ValidatorResolver,Neos\Flow\Validation $validatorResolver
Résultat Neos\Flow\Validation\ValidatorResolver