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
!7940
Resolve
#3303127
"Add config actions"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Resolve
#3303127
"Add config actions"
issue/drupal-3303127:3303127-add-config-actions
into
11.x
Overview
34
Commits
40
Pipelines
32
Changes
22
Open
Adam G-H
requested to merge
issue/drupal-3303127:3303127-add-config-actions
into
11.x
1 year ago
Overview
12
Commits
40
Pipelines
32
Changes
22
Expand
Closes
#3303127
0
0
Merge request reports
Compare
11.x
version 32
258442cf
9 months ago
version 31
36f9441f
9 months ago
version 30
daac6f97
9 months ago
version 29
606b37aa
9 months ago
version 28
a3d19f75
9 months ago
version 27
a71d7eef
9 months ago
version 26
e2e15c5a
9 months ago
version 25
4f7679e3
9 months ago
version 24
f6f9ecd6
9 months ago
version 23
efd71b11
9 months ago
version 22
25c12ff5
9 months ago
version 21
05827e4a
9 months ago
version 20
cea01f7b
9 months ago
version 19
91cbd496
10 months ago
version 18
3e745199
10 months ago
version 17
0543701f
10 months ago
version 16
36330b8e
10 months ago
version 15
36330b8e
10 months ago
version 14
85f81556
10 months ago
version 13
6b21ad85
11 months ago
version 12
d962144e
1 year ago
version 11
14feac8d
1 year ago
version 10
9d836ccc
1 year ago
version 9
d4322fc5
1 year ago
version 8
d6f85405
1 year ago
version 7
cf6b8a0b
1 year ago
version 6
ca5b5ce6
1 year ago
version 5
0748b7bf
1 year ago
version 4
304136a0
1 year ago
version 3
5fb4d510
1 year ago
version 2
e76c69f7
1 year ago
version 1
9a80e0cc
1 year ago
11.x (base)
and
latest version
latest version
bd159776
40 commits,
9 months ago
version 32
258442cf
39 commits,
9 months ago
version 31
36f9441f
38 commits,
9 months ago
version 30
daac6f97
37 commits,
9 months ago
version 29
606b37aa
36 commits,
9 months ago
version 28
a3d19f75
35 commits,
9 months ago
version 27
a71d7eef
34 commits,
9 months ago
version 26
e2e15c5a
33 commits,
9 months ago
version 25
4f7679e3
32 commits,
9 months ago
version 24
f6f9ecd6
30 commits,
9 months ago
version 23
efd71b11
27 commits,
9 months ago
version 22
25c12ff5
26 commits,
9 months ago
version 21
05827e4a
25 commits,
9 months ago
version 20
cea01f7b
24 commits,
9 months ago
version 19
91cbd496
22 commits,
10 months ago
version 18
3e745199
21 commits,
10 months ago
version 17
0543701f
19 commits,
10 months ago
version 16
36330b8e
18 commits,
10 months ago
version 15
36330b8e
18 commits,
10 months ago
version 14
85f81556
17 commits,
10 months ago
version 13
6b21ad85
15 commits,
11 months ago
version 12
d962144e
14 commits,
1 year ago
version 11
14feac8d
13 commits,
1 year ago
version 10
9d836ccc
12 commits,
1 year ago
version 9
d4322fc5
11 commits,
1 year ago
version 8
d6f85405
10 commits,
1 year ago
version 7
cf6b8a0b
9 commits,
1 year ago
version 6
ca5b5ce6
8 commits,
1 year ago
version 5
0748b7bf
7 commits,
1 year ago
version 4
304136a0
6 commits,
1 year ago
version 3
5fb4d510
5 commits,
1 year ago
version 2
e76c69f7
4 commits,
1 year ago
version 1
9a80e0cc
3 commits,
1 year ago
22 files
+
640
−
61
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
22
Search (e.g. *.vue) (Ctrl+P)
core/lib/Drupal/Core/Config/Action/Attribute/ActionMethod.php
+
13
−
0
Options
@@ -5,7 +5,9 @@
@@ -5,7 +5,9 @@
namespace
Drupal\Core\Config\Action\Attribute
;
namespace
Drupal\Core\Config\Action\Attribute
;
// cspell:ignore inflector
// cspell:ignore inflector
use
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
;
use
Drupal\Core\Config\Action\Exists
;
use
Drupal\Core\Config\Action\Exists
;
use
Drupal\Core\Extension\ExtensionDiscovery
;
use
Drupal\Core\StringTranslation\TranslatableMarkup
;
use
Drupal\Core\StringTranslation\TranslatableMarkup
;
/**
/**
@@ -30,12 +32,23 @@ final class ActionMethod {
@@ -30,12 +32,23 @@ final class ActionMethod {
* ID. For example, if the method is called 'addArray' this can be set to
* ID. For example, if the method is called 'addArray' this can be set to
* 'addMultipleArrays'. Set to FALSE if a pluralized version does not make
* 'addMultipleArrays'. Set to FALSE if a pluralized version does not make
* logical sense.
* logical sense.
* @param string|null $name
* The name of the action, if it should differ from the method name. Will be
* pluralized if $pluralize is TRUE. Must follow the rules for a valid PHP
* function name (e.g., no spaces, no Unicode characters, etc.). If used,
* the actual name of the method will NOT be available as an action name.
*
* @see https://www.php.net/manual/en/functions.user-defined.php
*/
*/
public
function
__construct
(
public
function
__construct
(
public
readonly
Exists
$exists
=
Exists
::
ErrorIfNotExists
,
public
readonly
Exists
$exists
=
Exists
::
ErrorIfNotExists
,
public
readonly
TranslatableMarkup
|
string
$adminLabel
=
''
,
public
readonly
TranslatableMarkup
|
string
$adminLabel
=
''
,
public
readonly
bool
|
string
$pluralize
=
TRUE
,
public
readonly
bool
|
string
$pluralize
=
TRUE
,
public
readonly
?string
$name
=
NULL
,
)
{
)
{
if
(
$name
&&
!
preg_match
(
ExtensionDiscovery
::
PHP_FUNCTION_PATTERN
,
$name
))
{
throw
new
InvalidPluginDefinitionException
(
'entity_method'
,
sprintf
(
"'%s' is not a valid PHP function name."
,
$name
));
}
}
}
}
}
Loading