Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Merge requests
!11545
Bundle attribute with compiler pass
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Bundle attribute with compiler pass
issue/drupal-3301682:3301682-bundle-attribute-disco
into
11.x
Overview
10
Commits
5
Pipelines
4
Changes
10
2 unresolved threads
Show all comments
Open
Michael Strelan
requested to merge
issue/drupal-3301682:3301682-bundle-attribute-disco
into
11.x
2 months ago
Overview
10
Commits
5
Pipelines
4
Changes
10
2 unresolved threads
Show all comments
Expand
Closes
#3301682
0
0
Merge request reports
Compare
11.x
version 3
dc2e8d56
2 months ago
version 2
087e1a63
2 months ago
version 1
6c43efce
2 months ago
11.x (HEAD)
and
latest version
latest version
93d3deef
5 commits,
2 months ago
version 3
dc2e8d56
4 commits,
2 months ago
version 2
087e1a63
3 commits,
2 months ago
version 1
6c43efce
2 commits,
2 months ago
10 files
+
166
−
16
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Entity/Attribute/Bundle.php
0 → 100644
+
34
−
0
Options
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\Core\Entity\Attribute
;
use
Drupal\Core\StringTranslation\TranslatableMarkup
;
/**
* Defines an attribute for registering a bundle class.
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
class
Bundle
{
/**
* Constructs a Bundle attribute object.
*
* @param string $entityTypeId
* The entity type ID.
* @param string|null $bundle
* The bundle ID, or NULL to use the entity type ID.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* The label of the bundle.
*/
public
function
__construct
(
// @todo see if we can infer the entity type automatically.
public
string
$entityTypeId
,
public
?string
$bundle
=
NULL
,
public
?TranslatableMarkup
$label
=
NULL
,
)
{
$this
->
bundle
??=
$this
->
entityTypeId
;
}
}
Loading