recursion example

class EntityLoadedEventFactory
{
    public function __construct(private readonly DefinitionInstanceRegistry $registry)
    {
    }

    /** * @param array<mixed> $entities */
    public function create(array $entities, Context $context): EntityLoadedContainerEvent
    {
        $mapping = $this->recursion($entities[]);

        $generator = fn (EntityDefinition $definition, array $entities) => new EntityLoadedEvent($definition$entities$context);

        return $this->buildEvents($mapping$generator$context);
    }

    /** * @param array<mixed> $entities */
    public function createPartial(array $entities, Context $context): EntityLoadedContainerEvent
    {
        

    public function group(array $filters, EntityDefinition $definition, array $additionalFields = []): array
    {
        $mapped = $this->recursion($filters$definition, MultiFilter::CONNECTION_AND, false);

        $new = [];
        if (\array_key_exists(self::NOT_RELEVANT, $mapped)) {
            $new = $mapped[self::NOT_RELEVANT];
            unset($mapped[self::NOT_RELEVANT]);
        }

        $duplicates = $this->getDuplicates($mapped$additionalFields);

        $level = 1;
        foreach ($mapped as $groups) {
            
Home | Imprint | This part of the site doesn't use cookies.