class AllowedObjectsListener (View source)

An onFlush listener for Flow's Doctrine PersistenceManager, that validates to be persisted entities against the list of allowed objects.

This listener is outsourced from the PersistenceManager to avoid recursive dependencies when building the EntityManager.

Properties

protected LoggerInterface $logger
protected ThrowableStorageInterface $throwableStorage
protected AllowedObjectsContainer $allowedObjects
protected PersistenceManagerInterface $persistenceManager

Methods

onFlush(OnFlushEventArgs $args)

Doctrine onFlush listener that checks for only allowed objects and reconnects if the database connection was closed.

void
throwExceptionIfObjectIsNotAllowed(object $object)

Checks if the given object is allowed and if not, throws an exception

Details

onFlush(OnFlushEventArgs $args)

Doctrine onFlush listener that checks for only allowed objects and reconnects if the database connection was closed.

Parameters

OnFlushEventArgs $args

Exceptions

Exception

protected void throwExceptionIfObjectIsNotAllowed(object $object)

Checks if the given object is allowed and if not, throws an exception

Parameters

object $object

Return Value

void

Exceptions

Exception