class ConfigEntityTypeResolver in GraphQL 8
Same name and namespace in other branches
- 8.2 src/TypeResolver/ConfigEntityTypeResolver.php \Drupal\graphql\TypeResolver\ConfigEntityTypeResolver
Resolves the schema for config entities.
Hierarchy
- class \Drupal\graphql\TypeResolver\ConfigEntityTypeResolver implements TypeResolverInterface
Expanded class hierarchy of ConfigEntityTypeResolver
1 string reference to 'ConfigEntityTypeResolver'
1 service uses ConfigEntityTypeResolver
File
- src/
TypeResolver/ ConfigEntityTypeResolver.php, line 13
Namespace
Drupal\graphql\TypeResolverView source
class ConfigEntityTypeResolver implements TypeResolverInterface {
/**
* The entity manager service.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* Constructs a ConfigEntityTypeResolver object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entityManager
* The entity manager service.
*/
public function __construct(EntityManagerInterface $entityManager) {
$this->entityManager = $entityManager;
}
/**
* {@inheritdoc}
*/
public function applies($type) {
if ($type instanceof EntityDataDefinitionInterface) {
$entityTypeId = $type
->getEntityTypeId();
$entityType = $this->entityManager
->getDefinition($entityTypeId);
return $entityType
->isSubclassOf('\\Drupal\\Core\\Config\\Entity\\ConfigEntityInterface');
}
return FALSE;
}
/**
* {@inheritdoc}
*/
public function resolveRecursive($type) {
// @todo We do not currently support config entities.
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigEntityTypeResolver:: |
protected | property | The entity manager service. | |
ConfigEntityTypeResolver:: |
public | function |
Overrides TypeResolverInterface:: |
|
ConfigEntityTypeResolver:: |
public | function |
Overrides TypeResolverInterface:: |
|
ConfigEntityTypeResolver:: |
public | function | Constructs a ConfigEntityTypeResolver object. |