class EqViewsData in EntityFieldQuery Views Backend 8
Hierarchy
- class \Drupal\efq_views\EqViewsData implements EntityHandlerInterface, EntityViewsDataInterface uses StringTranslationTrait
Expanded class hierarchy of EqViewsData
1 file declares its use of EqViewsData
- EntityTypeAlter.php in src/
Hooks/ EntityTypeAlter.php - Contains \Drupal\efq_views\Hooks\EntityTypeAlter.
File
- src/
EqViewsData.php, line 16 - Contains \Drupal\efq_views\EqViewsData.
Namespace
Drupal\efq_viewsView source
class EqViewsData implements EntityViewsDataInterface, EntityHandlerInterface {
use StringTranslationTrait;
/**
* @var \Drupal\Core\Entity\EntityTypeInterface
*/
protected $entityType;
public function __construct(EntityTypeInterface $entityType) {
$this->entityType = $entityType;
}
/**
* {@inheritdoc}
*/
public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
return new static($entity_type);
}
/**
* {@inheritdoc}
*/
public function getViewsData() {
$data = [];
$base_table = 'eq__' . $this->entityType
->id();
$data[$base_table]['table']['group'] = $this
->t('EQ @label', [
'@label' => $this->entityType
->getLabel(),
]);
$data[$base_table]['table']['provider'] = $this->entityType
->getProvider();
$data[$base_table]['table']['base'] = [
'query_id' => 'entity_field_query',
'field' => $this->entityType
->getKey('id'),
'title' => $this
->t('EQ @label', [
'@label' => $this->entityType
->getLabel(),
]),
'cache_contexts' => $this->entityType
->getListCacheContexts(),
];
return $data;
}
/**
* {@inheritdoc}
*/
public function getViewsTableForEntityType(EntityTypeInterface $entity_type) {
return 'efq__' . $entity_type
->id();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EqViewsData:: |
protected | property | ||
EqViewsData:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
|
EqViewsData:: |
public | function |
Returns views data for the entity type. Overrides EntityViewsDataInterface:: |
|
EqViewsData:: |
public | function |
Gets the table of an entity type to be used as base table in views. Overrides EntityViewsDataInterface:: |
|
EqViewsData:: |
public | function | ||
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |