Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
workflow
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
workflow
Commits
f1a24a6f
Commit
f1a24a6f
authored
1 year ago
by
John Voskuilen
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2919482
: Clean code - WorkflowItem.php
parent
ad73361b
No related branches found
No related tags found
No related merge requests found
Pipeline
#128761
passed with warnings
1 year ago
Stage: build
Stage: validate
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Field/FieldType/WorkflowItem.php
+6
-27
6 additions, 27 deletions
src/Plugin/Field/FieldType/WorkflowItem.php
with
6 additions
and
27 deletions
src/Plugin/Field/FieldType/WorkflowItem.php
+
6
−
27
View file @
f1a24a6f
...
...
@@ -72,40 +72,19 @@ class WorkflowItem extends ListItemBase {
$key
.
=
$definition
[
'settings'
][
'target_bundle'
]
??
''
;
if
(
!
isset
(
$propertyDefinitions
[
$key
]))
{
$propertyDefinitions
[
$key
][
'value'
]
=
DataDefinition
::
create
(
'string'
)
// @todo D8-port: or 'any'
$propertyDefinitions
[
$key
][
'value'
]
=
DataDefinition
::
create
(
'string'
)
->
setLabel
(
t
(
'Workflow state'
))
->
addConstraint
(
'Length'
,
[
'max'
=>
128
])
->
setRequired
(
TRUE
);
// workflow_debug(__FILE__, __FUNCTION__, __LINE__); // @todo D8: test this snippet.
/*
$propertyDefinitions[$key]['workflow_transition'] = DataDefinition::create('any')
/*
$propertyDefinitions[$key]['workflow_transition'] = DataDefinition::create('any')
// $properties['workflow_transition'] = DataDefinition::create('WorkflowTransition')
->setLabel(t('Transition'))
->setDescription(t('The computed WorkflowItem object.'))
->setComputed(TRUE)
->setClass('\Drupal\workflow\Entity\WorkflowTransition')
->setSetting('date source', 'value');
$propertyDefinitions[$key]['display'] = array(
'type' => 'boolean',
'label' => t('Flag to control whether this file should be displayed when viewing content.'),
);
$propertyDefinitions[$key]['description'] = array(
'type' => 'string',
'label' => t('A description of the file.'),
);
$propertyDefinitions[$key]['display'] = array(
'type' => 'boolean',
'label' => t('Flag to control whether this file should be displayed when viewing content.'),
);
$propertyDefinitions[$key]['description'] = array(
'type' => 'string',
'label' => t('A description of the file.'),
);
*/
->setClass('\Drupal\workflow\Entity\WorkflowTransition');
// ->setSetting('date source', 'value');
*/
}
return
$propertyDefinitions
[
$key
];
}
...
...
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