function EntityType::hasHandlerClass

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::hasHandlerClass()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::hasHandlerClass()
  3. 11.x core/lib/Drupal/Core/Entity/EntityType.php \Drupal\Core\Entity\EntityType::hasHandlerClass()

Overrides EntityTypeInterface::hasHandlerClass

3 calls to EntityType::hasHandlerClass()
EntityType::getHandlerClass in core/lib/Drupal/Core/Entity/EntityType.php
EntityType::hasListBuilderClass in core/lib/Drupal/Core/Entity/EntityType.php
Indicates if this entity type has a list class.
EntityType::hasViewBuilderClass in core/lib/Drupal/Core/Entity/EntityType.php
Indicates if this entity type has a view builder.

File

core/lib/Drupal/Core/Entity/EntityType.php, line 503

Class

EntityType
Provides an implementation of an entity type and its metadata.

Namespace

Drupal\Core\Entity

Code

public function hasHandlerClass($handler_type, $nested = FALSE) {
    $handlers = $this->getHandlerClasses();
    if (!isset($handlers[$handler_type]) || $nested && !isset($handlers[$handler_type][$nested])) {
        return FALSE;
    }
    $handler = $handlers[$handler_type];
    if ($nested) {
        $handler = $handler[$nested];
    }
    return class_exists($handler);
}

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