plugin/lti/Listener/LtiListener.php
public function onLoad(LoadResourceEvent $event)
    {
        $ltiResource = $event->getResource();
        $collection = new ResourceCollection([$ltiResource->getResourceNode()]);
        $ltiApps = $this->authorization->isGranted('EDIT', $collection) ?
            $this->ltiAppRepo->findBy([], ['title' => 'ASC']) :
            [];

        $event->setData([
            'ltiResource' => $this->serializer->serialize($ltiResource),
            'ltiApps' => array_map(function (LtiApp $app) {
                return $this->serializer->serialize($app, [Options::SERIALIZE_MINIMAL]);
            }, $ltiApps),
        ]);

        $event->stopPropagation();
    }
public function onLoad(LoadResourceEvent $event)
    {
        $ltiResource = $event->getResource();
        $collection = new ResourceCollection([$ltiResource->getResourceNode()]);
        $ltiApps = $this->authorization->isGranted('EDIT', $collection) ?
            $this->ltiAppRepo->findBy([], ['title' => 'ASC']) :
            [];

        $event->setData([
            'ltiResource' => $this->serializer->serialize($ltiResource),
            'ltiApps' => array_map(function (LtiApp $app) {
                return $this->serializer->serialize($app, [Options::SERIALIZE_MINIMAL]);
            }, $ltiApps),
        ]);

        $event->stopPropagation();
    }
public function onLoad ( LoadResourceEvent $ event ) { $ ltiResource = $ event -> getResource ( ) ; $ collection = new ResourceCollection ( [ $ ltiResource -> getResourceNode ( ) ] ) ; $ ltiApps = $ this -> authorization -> isGranted ( 'EDIT' , $ collection ) ? $ this -> ltiAppRepo -> findBy ( [ ] , [ 'title' => 'ASC' ] ) : [ ] ; $ event -> setData ( [ 'ltiResource' => $ this -> serializer -> serialize ( $ ltiResource ) , 'ltiApps' => array_map ( function ( LtiApp $ app ) { return $ this -> serializer -> serialize ( $ app , [ Options :: SERIALIZE_MINIMAL ] ) ; } , $ ltiApps ) , ] ) ; $ event -> stopPropagation ( ) ; }
Loads a LTI resource.

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

@param LoadResourceEvent $event
Loads a LTI resource .