function WorkspacesEntityRepository::getActiveMultiple
Retrieves the active entity variants matching the specified context.
Parameters
string $entity_type_id: The entity type identifier.
int[]|string[] $entity_ids: An array of entity identifiers.
array|null $contexts: (optional) An associative array of arbitrary data that can be useful to determine the proper fallback sequence. See \Drupal\Core\Language\LanguageManagerInterface::getFallbackCandidates(). Using context ids from the plugin context system is deprecated.
Return value
\Drupal\Core\Entity\EntityInterface[] An array of entity object variants keyed by entity ID.
Overrides EntityRepositoryInterface::getActiveMultiple
File
-
core/
modules/ workspaces/ src/ WorkspacesEntityRepository.php, line 54
Class
- WorkspacesEntityRepository
- Provides workspace-specific mechanisms for retrieving entities.
Namespace
Drupal\workspacesCode
public function getActiveMultiple($entity_type_id, array $entity_ids, ?array $contexts = NULL) {
// When there's no active workspace, the active entity variant is the
// canonical one.
if (!$this->workspaceManager
->hasActiveWorkspace()) {
return $this->inner
->getCanonicalMultiple($entity_type_id, $entity_ids, $contexts);
}
return $this->inner
->getActiveMultiple($entity_type_id, $entity_ids, $contexts);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.