class EntityQueryMapQueryProvider in GraphQL 8.3
Hierarchy
- class \Drupal\graphql\GraphQL\QueryProvider\EntityQueryMapQueryProvider implements QueryProviderInterface
Expanded class hierarchy of EntityQueryMapQueryProvider
1 string reference to 'EntityQueryMapQueryProvider'
1 service uses EntityQueryMapQueryProvider
File
- src/
GraphQL/ QueryProvider/ EntityQueryMapQueryProvider.php, line 8
Namespace
Drupal\graphql\GraphQL\QueryProviderView source
class EntityQueryMapQueryProvider implements QueryProviderInterface {
/**
* The entity type manager service.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* QueryProvider constructor.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* The entity type manager service.
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
$this->entityTypeManager = $entityTypeManager;
}
/**
* {@inheritdoc}
*/
public function getQuery($id, OperationParams $operation) {
list($version, $id) = explode(':', $id);
// Check that the id is properly formatted.
if (empty($version) || empty($id)) {
return NULL;
}
$storage = $this->entityTypeManager
->getStorage('graphql_query_map');
/** @var \Drupal\graphql\Entity\QueryMapInterface $map */
if ($map = $storage
->load($version)) {
return $map
->getQuery($id);
}
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityQueryMapQueryProvider:: |
protected | property | The entity type manager service. | |
EntityQueryMapQueryProvider:: |
public | function |
Returns a query string given the query parameters. Overrides QueryProviderInterface:: |
|
EntityQueryMapQueryProvider:: |
public | function | QueryProvider constructor. |