plugin/wiki/Listener/Resource/WikiListener.php
public function load(LoadResourceEvent $event)
    {
        $resourceNode = $event->getResourceNode();

        /** @var Wiki $wiki */
        $wiki = $event->getResource();
        $sectionTree = $this->sectionManager->getSerializedSectionTree(
            $wiki,
            $this->tokenStorage->getToken()->getUser() instanceof User ? $this->tokenStorage->getToken()->getUser() : null,
            $this->checkPermission('EDIT', $resourceNode)
        );

        $event->setData([
            'wiki' => $this->serializer->serialize($wiki),
            'sections' => $sectionTree,
        ]);

        $event->stopPropagation();
    }
public function load(LoadResourceEvent $event)
    {
        $resourceNode = $event->getResourceNode();

        /** @var Wiki $wiki */
        $wiki = $event->getResource();
        $sectionTree = $this->sectionManager->getSerializedSectionTree(
            $wiki,
            $this->tokenStorage->getToken()->getUser() instanceof User ? $this->tokenStorage->getToken()->getUser() : null,
            $this->checkPermission('EDIT', $resourceNode)
        );

        $event->setData([
            'wiki' => $this->serializer->serialize($wiki),
            'sections' => $sectionTree,
        ]);

        $event->stopPropagation();
    }
public function load ( LoadResourceEvent $ event ) { $ resourceNode = $ event -> getResourceNode ( ) ; /** @var Wiki $wiki */ $ wiki = $ event -> getResource ( ) ; $ sectionTree = $ this -> sectionManager -> getSerializedSectionTree ( $ wiki , $ this -> tokenStorage -> getToken ( ) -> getUser ( ) instanceof User ? $ this -> tokenStorage -> getToken ( ) -> getUser ( ) : null , $ this -> checkPermission ( 'EDIT' , $ resourceNode ) ) ; $ event -> setData ( [ 'wiki' => $ this -> serializer -> serialize ( $ wiki ) , 'sections' => $ sectionTree , ] ) ; $ event -> stopPropagation ( ) ; }
Loads a Wiki resource.

@DI\Observe("resource.icap_wiki.load")

@param LoadResourceEvent $event
Loads a Wiki resource .