public function EntityManager::hasController

Checks whether a certain entity type has a certain controller.

Parameters

string $entity_type: The name of the entity type.

string $controller_type: The name of the controller.

Return value

bool Returns TRUE if the entity type has the controller, else FALSE.

File

drupal/core/lib/Drupal/Core/Entity/EntityManager.php, line 84
Contains \Drupal\Core\Entity\EntityManager.

Class

EntityManager
Manages entity type plugin definitions.

Namespace

Drupal\Core\Entity

Code

public function hasController($entity_type, $controller_type) {
  $definition = $this
    ->getDefinition($entity_type);
  return !empty($definition['controllers'][$controller_type]);
}