Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_inheritance
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
field_inheritance
Commits
c691ada1
Commit
c691ada1
authored
2 years ago
by
Dharti Patel
Committed by
Owen Bush
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3312286
by Dharti Patel, Arturo1007, owenbush: Drupal coding Standard Issues
parent
d4c251a7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
field_inheritance.api.php
+4
-4
4 additions, 4 deletions
field_inheritance.api.php
src/Entity/FieldInheritance.php
+8
-8
8 additions, 8 deletions
src/Entity/FieldInheritance.php
src/Form/FieldInheritanceForm.php
+0
-1
0 additions, 1 deletion
src/Form/FieldInheritanceForm.php
with
12 additions
and
13 deletions
field_inheritance.api.php
+
4
−
4
View file @
c691ada1
...
...
@@ -23,16 +23,16 @@ function hook_field_inheritance_inheritance_class_alter(&$class, $field) {
* Alter the computed value for an inherited field.
*
* @param array $value
*
Array of field item values
* Array of field item values
.
* @param array $context
*
Array of context information for the field inheritance, with keys:
* Array of context information for the field inheritance, with keys:
* - source_field
* - source_entity
* - destination_field
* - destination_entity
* - method
* - method
.
*/
function
field_inheritance_field_inheritance_compute_value_alter
(
&
$value
,
$context
)
{
function
field_inheritance_field_inheritance_compute_value_alter
(
array
&
$value
,
array
$context
)
{
if
(
$context
[
'destination_field'
]
===
'my_field'
)
{
$value
[
0
][
'value'
]
=
'foo'
;
}
...
...
This diff is collapsed.
Click to expand it.
src/Entity/FieldInheritance.php
+
8
−
8
View file @
c691ada1
...
...
@@ -127,7 +127,7 @@ class FieldInheritance extends ConfigEntityBase implements FieldInheritanceInter
* {@inheritdoc}
*/
public
function
type
()
{
return
isset
(
$this
->
type
)
?
$this
->
type
:
NULL
;
return
$this
->
type
?
?
NULL
;
}
/**
...
...
@@ -142,49 +142,49 @@ class FieldInheritance extends ConfigEntityBase implements FieldInheritanceInter
* {@inheritdoc}
*/
public
function
sourceEntityType
()
{
return
isset
(
$this
->
sourceEntityType
)
?
$this
->
sourceEntityType
:
NULL
;
return
$this
->
sourceEntityType
?
?
NULL
;
}
/**
* {@inheritdoc}
*/
public
function
destinationEntityType
()
{
return
isset
(
$this
->
destinationEntityType
)
?
$this
->
destinationEntityType
:
NULL
;
return
$this
->
destinationEntityType
?
?
NULL
;
}
/**
* {@inheritdoc}
*/
public
function
sourceEntityBundle
()
{
return
isset
(
$this
->
sourceEntityBundle
)
?
$this
->
sourceEntityBundle
:
NULL
;
return
$this
->
sourceEntityBundle
?
?
NULL
;
}
/**
* {@inheritdoc}
*/
public
function
destinationEntityBundle
()
{
return
isset
(
$this
->
destinationEntityBundle
)
?
$this
->
destinationEntityBundle
:
NULL
;
return
$this
->
destinationEntityBundle
?
?
NULL
;
}
/**
* {@inheritdoc}
*/
public
function
sourceField
()
{
return
isset
(
$this
->
sourceField
)
?
$this
->
sourceField
:
NULL
;
return
$this
->
sourceField
?
?
NULL
;
}
/**
* {@inheritdoc}
*/
public
function
destinationField
()
{
return
isset
(
$this
->
destinationField
)
?
$this
->
destinationField
:
NULL
;
return
$this
->
destinationField
?
?
NULL
;
}
/**
* {@inheritdoc}
*/
public
function
plugin
()
{
return
isset
(
$this
->
plugin
)
?
$this
->
plugin
:
NULL
;
return
$this
->
plugin
?
?
NULL
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/Form/FieldInheritanceForm.php
+
0
−
1
View file @
c691ada1
...
...
@@ -419,7 +419,6 @@ class FieldInheritanceForm extends EntityForm {
];
}
return
$form
;
}
...
...
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