public function ProvisionService::getProvisionFromContext in LTI Tool Provider 2.x
Same name and namespace in other branches
- 8 modules/lti_tool_provider_provision/src/Services/ProvisionService.php \Drupal\lti_tool_provider_provision\Services\ProvisionService::getProvisionFromContext()
Parameters
$context:
Return value
EntityInterface|null
Throws
InvalidPluginDefinitionException
1 call to ProvisionService::getProvisionFromContext()
- ProvisionService::provision in modules/
lti_tool_provider_provision/ src/ Services/ ProvisionService.php
File
- modules/
lti_tool_provider_provision/ src/ Services/ ProvisionService.php, line 126
Class
Namespace
Drupal\lti_tool_provider_provision\ServicesCode
public function getProvisionFromContext($context) : ?EntityInterface {
$provision = $this->entityTypeManager
->getStorage('lti_tool_provider_provision')
->loadByProperties([
'consumer_id' => $context['consumer_id'],
'context_id' => $context['context_id'],
'resource_link_id' => $context['resource_link_id'],
]);
if (count($provision)) {
return reset($provision);
}
return NULL;
}