*/ class LtiLaunchDataService extends ConfigurableService { const SERVICE_ID = 'ltiDeliveryProvider/LtiLaunchData'; /** * @param LtiLaunchData $launchData * @return core_kernel_classes_Resource */ public function findDeliveryFromLaunchData(LtiLaunchData $launchData) { return $this->findResource($launchData->getCustomParameter('delivery')); } /** * @param LtiLaunchData $launchData * * @return core_kernel_classes_Container|core_kernel_classes_Resource */ public function findDeliveryExecutionFromLaunchData(LtiLaunchData $launchData) { return $this->findResource($launchData->getCustomParameter('execution')); } /** * @param $uri * * @return core_kernel_classes_Container|core_kernel_classes_Resource */ private function findResource($uri) { return $this->getServiceLocator()->get(LtiDeliveryFactory::SERVICE_ID)->create($uri); } }