src/Controller/Plugin/EntityEraser.php
public function loadEntities($entity, $id = null)
    {
        $params = $this->options;
        $params['id'] = $id;
        $params['repositories'] = $this->repositories;

        $event = $this->loadEntitiesEvents->getEvent($entity, $this, $params);
        $responses = $this->loadEntitiesEvents->triggerEventUntil(
            function ($response) {
                return (is_array($response) || $response instanceof \Traversable) && count($response);
            },
            $event
        );

        $entities = $responses->last();

        return $entities;
    }
public function loadEntities($entity, $id = null)
    {
        $params = $this->options;
        $params['id'] = $id;
        $params['repositories'] = $this->repositories;

        $event = $this->loadEntitiesEvents->getEvent($entity, $this, $params);
        $responses = $this->loadEntitiesEvents->triggerEventUntil(
            function ($response) {
                return (is_array($response) || $response instanceof \Traversable) && count($response);
            },
            $event
        );

        $entities = $responses->last();

        return $entities;
    }
Loads entities to be deleted.

Triggers an event on the "Core/EntityEraser/Load/Events" event manager.

@param string      $entity Used as event name.
@param string|null $id

@return array|\Traversable|null