Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_info_table
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
entity_info_table
Commits
ac7784c1
Commit
ac7784c1
authored
1 year ago
by
Zhang Terry
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3449974
by zterry95: support webform submission
parent
63d2f04b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity_info_table.links.menu.yml
+3
-3
3 additions, 3 deletions
entity_info_table.links.menu.yml
src/Controller/EntityInfoTableController.php
+20
-18
20 additions, 18 deletions
src/Controller/EntityInfoTableController.php
with
23 additions
and
21 deletions
entity_info_table.links.menu.yml
+
3
−
3
View file @
ac7784c1
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
This diff is collapsed.
Click to expand it.
src/Controller/EntityInfoTableController.php
+
20
−
18
View file @
ac7784c1
<?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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment