Skip to content
Snippets Groups Projects
Commit ac7784c1 authored by Zhang Terry's avatar Zhang Terry
Browse files

Issue #3449974 by zterry95: support webform submission

parent 63d2f04b
No related branches found
No related tags found
No related merge requests found
entity_info_table.manage:
entity_info_table.admin:
title: 'Entity Info Table'
parent: system.admin_config_system
parent: system.admin_reports
description: 'Administrative interface for the Entity info table module'
weight: -10
route_name: entity_info_table.manage
route_name: entity_info_table.admin
<?php
namespace Drupal\entity_info_table\Controller;
use Drupal\Component\Serialization\Json;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Url;
use Drupal\devel\DevelDumperManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\webform\Entity\Webform;
use Drupal\webform\WebformHelpManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
*
*/
class EntityInfoTableController extends ControllerBase {
/**
......@@ -16,14 +16,17 @@ class EntityInfoTableController extends ControllerBase {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('devel.dumper')
);
$container->get('devel.dumper')
);
}
/**
*
*/
public function render() {
$headers = [
$this->t('ID'),
$this->t('Name'),
$this->t('Entity Type ID'),
$this->t('Entity Type Name'),
$this->t('bundle'),
$this->t('bundle label'),
$this->t('Field name'),
......@@ -36,13 +39,12 @@ class EntityInfoTableController extends ControllerBase {
foreach ($this->entityTypeManager()->getDefinitions() as $entity_type_id => $entity_type) {
// Fail with an exception for non-fieldable entity types.
$bundle_list = \Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type_id);
// webform & webform_submission are different entity type :)
if ($entity_type_id == 'webform') {
// $query = \Drupal::service('entity.query')->get('webform');
// dpm($query);
continue;
}
if (!$entity_type->entityClassImplements(FieldableEntityInterface::class)) {
// dpm("Getting the base fields is not supported for entity type {$entity_type->getLabel()}.");
continue;
}
foreach ($bundle_list as $bundle_key => $bundle_info) {
......@@ -64,7 +66,7 @@ class EntityInfoTableController extends ControllerBase {
];
$row['bundle_label'] = [
'data' => $bundle_info['label'],
'filter' => false,
'filter' => FALSE,
];
$row['field_name'] = [
'data' => $field_definition->getLabel(),
......@@ -75,7 +77,6 @@ class EntityInfoTableController extends ControllerBase {
'filter' => TRUE,
];
$field_description = $field_definition->getFieldStorageDefinition()->getDescription() ? $field_definition->getFieldStorageDefinition()->getDescription() : NULL;
// dpm($field_description);
$row['field_description'] = [
'data' => $field_description,
'filter' => TRUE,
......@@ -103,4 +104,5 @@ class EntityInfoTableController extends ControllerBase {
return $output;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment