public function ProvisionService::getProvisionFromEntity in LTI Tool Provider 8
Same name and namespace in other branches
- 2.x 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 205
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;
}