public function DomainSourcePathProcessor::getEntity in Domain Access 8
Derive entity data from a given route's parameters.
Parameters
array $parameters: An array of route parameters.
Return value
\Drupal\Core\Entity\EntityInterface|null Returns the entity when available, otherwise NULL.
1 call to DomainSourcePathProcessor::getEntity()
- DomainSourcePathProcessor::processOutbound in domain_source/
src/ HttpKernel/ DomainSourcePathProcessor.php - Processes the outbound path.
File
- domain_source/
src/ HttpKernel/ DomainSourcePathProcessor.php, line 198
Class
- DomainSourcePathProcessor
- Processes the outbound path using path alias lookups.
Namespace
Drupal\domain_source\HttpKernelCode
public function getEntity(array $parameters) {
$entity = NULL;
$entity_type = key($parameters);
$entity_types = $this
->getEntityTypes();
foreach ($parameters as $entity_type => $value) {
if (!empty($entity_type) && isset($entity_types[$entity_type])) {
$entity = $this->entityTypeManager
->getStorage($entity_type)
->load($value);
}
}
return $entity;
}