function EntityHandlerBase::moduleHandler

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityHandlerBase.php \Drupal\Core\Entity\EntityHandlerBase::moduleHandler()
  2. 10 core/lib/Drupal/Core/Entity/EntityHandlerBase.php \Drupal\Core\Entity\EntityHandlerBase::moduleHandler()
  3. 8.9.x core/lib/Drupal/Core/Entity/EntityHandlerBase.php \Drupal\Core\Entity\EntityHandlerBase::moduleHandler()

Gets the module handler.

Return value

\Drupal\Core\Extension\ModuleHandlerInterface The module handler.

File

core/lib/Drupal/Core/Entity/EntityHandlerBase.php, line 31

Class

EntityHandlerBase
Provides a base class for entity handlers.

Namespace

Drupal\Core\Entity

Code

protected function moduleHandler() {
  if (!$this->moduleHandler) {
    $this->moduleHandler = \Drupal::moduleHandler();
  }
  return $this->moduleHandler;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.