function EntityRepository::getActive
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityRepository.php \Drupal\Core\Entity\EntityRepository::getActive()
- 8.9.x core/lib/Drupal/Core/Entity/EntityRepository.php \Drupal\Core\Entity\EntityRepository::getActive()
- 10 core/lib/Drupal/Core/Entity/EntityRepository.php \Drupal\Core\Entity\EntityRepository::getActive()
Overrides EntityRepositoryInterface::getActive
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityRepository.php, line 130
Class
- EntityRepository
- Provides several mechanisms for retrieving entities.
Namespace
Drupal\Core\EntityCode
public function getActive($entity_type_id, $entity_id, ?array $contexts = NULL) {
return current($this->getActiveMultiple($entity_type_id, [
$entity_id,
], $contexts)) ?: NULL;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.