public function createScheduleTimelineEntry(EntityPublishedEvent $event): void
    {
        // Only act on schedule objects.
        $schedule = $event->getObject();
        if (!$schedule instanceof Schedule) {
            return;
        }

        // Get the author for the schedule.
        $author = $this->user_provider->loadUserByUsername($schedule->getAuthor());

        // Create components for this action.
        $schedule_component = $this->action_manager->findOrCreateComponent($schedule);
        $author_component = $this->action_manager->findOrCreateComponent($author);

        // Add timeline entries for each group.
        foreach ($schedule->getGroups() as $group) {
            // Create the group component.
            $group_component = $this->action_manager->findOrCreateComponent($group);

            // Create the action and link it.
            $action = $this->action_manager->create($author_component, 'scheduled', [
                'directComplement' => $schedule_component,
                'indirectComplement' => $group_component,
            ]);

            // Update the action.
            $this->action_manager->updateAction($action);
        }
    }
public function createScheduleTimelineEntry(EntityPublishedEvent $event): void
    {
        // Only act on schedule objects.
        $schedule = $event->getObject();
        if (!$schedule instanceof Schedule) {
            return;
        }

        // Get the author for the schedule.
        $author = $this->user_provider->loadUserByUsername($schedule->getAuthor());

        // Create components for this action.
        $schedule_component = $this->action_manager->findOrCreateComponent($schedule);
        $author_component = $this->action_manager->findOrCreateComponent($author);

        // Add timeline entries for each group.
        foreach ($schedule->getGroups() as $group) {
            // Create the group component.
            $group_component = $this->action_manager->findOrCreateComponent($group);

            // Create the action and link it.
            $action = $this->action_manager->create($author_component, 'scheduled', [
                'directComplement' => $schedule_component,
                'indirectComplement' => $group_component,
            ]);

            // Update the action.
            $this->action_manager->updateAction($action);
        }
    }
public function createScheduleTimelineEntry ( EntityPublishedEvent $ event ) : void { // Only act on schedule objects. $ schedule = $ event -> getObject ( ) ; if ( ! $ schedule instanceof Schedule ) { return ; } // Get the author for the schedule. $ author = $ this -> user_provider -> loadUserByUsername ( $ schedule -> getAuthor ( ) ) ; // Create components for this action. $ schedule_component = $ this -> action_manager -> findOrCreateComponent ( $ schedule ) ; $ author_component = $ this -> action_manager -> findOrCreateComponent ( $ author ) ; // Add timeline entries for each group. foreach ( $ schedule -> getGroups ( ) as $ group ) { // Create the group component. $ group_component = $ this -> action_manager -> findOrCreateComponent ( $ group ) ; // Create the action and link it. $ action = $ this -> action_manager -> create ( $ author_component , 'scheduled' , [ 'directComplement' => $ schedule_component , 'indirectComplement' => $ group_component , ] ) ; // Update the action. $ this -> action_manager -> updateAction ( $ action ) ; } }
Create the schedule timeline entry.

@param EntityPublishedEvent $event The published event.

@return void
Create the schedule timeline entry .