class WebformManagedFileViews in Webform Views Integration 8.5
Default webform views handler for managed file webform elements.
Hierarchy
- class \Drupal\webform_views\WebformElementViews\WebformElementViewsAbstract implements ContainerInjectionInterface, WebformElementViewsInterface uses StringTranslationTrait
- class \Drupal\webform_views\WebformElementViews\WebformManagedFileViews
Expanded class hierarchy of WebformManagedFileViews
1 file declares its use of WebformManagedFileViews
- webform_views.module in ./
webform_views.module - Webform integration with views.
File
- src/
WebformElementViews/ WebformManagedFileViews.php, line 12
Namespace
Drupal\webform_views\WebformElementViewsView source
class WebformManagedFileViews extends WebformElementViewsAbstract {
/**
* Entity type manager service.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* WebformManagedFileViews constructor.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* Entity type manager.
* @param \Drupal\webform\Plugin\WebformElementManagerInterface $webform_element_manager
* Webform element manager.
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager, WebformElementManagerInterface $webform_element_manager) {
parent::__construct($entity_type_manager, $webform_element_manager);
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public function getElementViewsData(WebformElementInterface $element_plugin, array $element) {
$views_data = parent::getElementViewsData($element_plugin, $element);
if ($this->entityTypeManager
->hasDefinition('file')) {
$file = $this->entityTypeManager
->getDefinition('file');
$views_data['relationship'] = [
'base' => $file
->getDataTable() ? $file
->getDataTable() : $file
->getBaseTable(),
'field' => 'value',
'base field' => $file
->getKey('id'),
'label' => $this
->t('@element: File', [
'@element' => $element['#title'],
]),
'id' => 'standard',
];
}
return $views_data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. | |
WebformElementViewsAbstract:: |
protected | property | Webform submission entity type. | |
WebformElementViewsAbstract:: |
protected | property | ||
WebformElementViewsAbstract:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
WebformElementViewsAbstract:: |
public | function |
Generate views data related to a given element of a given webform. Overrides WebformElementViewsInterface:: |
2 |
WebformElementViewsAbstract:: |
protected | function | Generate views table name that represents a given element within a webform. | |
WebformManagedFileViews:: |
protected | property | Entity type manager service. | |
WebformManagedFileViews:: |
public | function |
Generate views data definition that corresponds to given webform element. Overrides WebformElementViewsAbstract:: |
|
WebformManagedFileViews:: |
public | function |
WebformManagedFileViews constructor. Overrides WebformElementViewsAbstract:: |