public function ProvisionService::getProvisionFromEntity 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::getProvisionFromEntity()
Parameters
EntityInterface $entity:
Return value
EntityInterface|null
Throws
InvalidPluginDefinitionException
File
- modules/
lti_tool_provider_provision/ src/ Services/ ProvisionService.php, line 210
Class
Namespace
Drupal\lti_tool_provider_provision\ServicesCode
public function getProvisionFromEntity(EntityInterface $entity) : ?EntityInterface {
$provision = $this->entityTypeManager
->getStorage('lti_tool_provider_provision')
->loadByProperties([
'provision_type' => $entity
->getEntityTypeId(),
'provision_bundle' => $entity
->bundle(),
'provision_id' => $entity
->id(),
]);
if (count($provision)) {
return reset($provision);
}
return NULL;
}