ArrayWriter example

protected function configure(): void
    {
    }

    /** * @param list<HookableEventDoc> $eventsDoc */
    private function collectBusinessEvent(array &$eventsDoc): void
    {
        $context = Context::createDefaultContext();
        $businessEvents = $this->businessEventCollector->collect($context);
        $eventDoc = new ArrayWriter(self::EVENT_DESCRIPTIONS);

        foreach ($businessEvents as $event) {
            $eventDoc->ensure($event->getName());

            $eventsDoc[] = HookableEventDoc::fromBusinessEvent(
                $event,
                $this->hookableEventCollector->getPrivilegesFromBusinessEventDefinition($event),
                $eventDoc->get($event->getName())
            );
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.