class EntityHandlerBase
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Entity/EntityHandlerBase.php \Drupal\Core\Entity\EntityHandlerBase
- 10 core/lib/Drupal/Core/Entity/EntityHandlerBase.php \Drupal\Core\Entity\EntityHandlerBase
- 8.9.x core/lib/Drupal/Core/Entity/EntityHandlerBase.php \Drupal\Core\Entity\EntityHandlerBase
Provides a base class for entity handlers.
Hierarchy
- class \Drupal\Core\Entity\EntityHandlerBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait
Expanded class hierarchy of EntityHandlerBase
Related topics
1 file declares its use of EntityHandlerBase
- EntityTypeManagerTest.php in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityTypeManagerTest.php - Contains \Drupal\Tests\Core\Entity\EntityTypeManagerTest.
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityHandlerBase.php, line 14
Namespace
Drupal\Core\EntityView source
abstract class EntityHandlerBase {
use StringTranslationTrait;
use DependencySerializationTrait;
/**
* The module handler to invoke hooks on.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Gets the module handler.
*
* @return \Drupal\Core\Extension\ModuleHandlerInterface
* The module handler.
*/
protected function moduleHandler() {
if (!$this->moduleHandler) {
$this->moduleHandler = \Drupal::moduleHandler();
}
return $this->moduleHandler;
}
/**
* Sets the module handler for this handler.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*
* @return $this
*/
public function setModuleHandler(ModuleHandlerInterface $module_handler) {
$this->moduleHandler = $module_handler;
return $this;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.