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
!9094
remove 'entity_resolver'
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
remove 'entity_resolver'
issue/drupal-2930243:2930243-move-entity-resolver
into
11.x
Overview
0
Commits
1
Pipelines
1
Changes
11
Open
quietone
requested to merge
issue/drupal-2930243:2930243-move-entity-resolver
into
11.x
9 months ago
Overview
0
Commits
1
Pipelines
1
Changes
11
Expand
Closes
#2930243
0
0
Merge request reports
Compare
11.x
11.x (base)
and
latest version
latest version
26940627
1 commit,
9 months ago
11 files
+
0
−
532
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
Search (e.g. *.vue) (Ctrl+P)
core/modules/serialization/src/EntityResolver/ChainEntityResolver.php deleted
100644 → 0
+
0
−
48
Options
<?php
namespace
Drupal\serialization\EntityResolver
;
use
Symfony\Component\Serializer\Normalizer\NormalizerInterface
;
/**
* Resolver delegating the entity resolution to a chain of resolvers.
*/
class
ChainEntityResolver
implements
ChainEntityResolverInterface
{
/**
* The concrete resolvers.
*
* @var \Drupal\serialization\EntityResolver\EntityResolverInterface[]
*/
protected
$resolvers
=
[];
/**
* Constructs a ChainEntityResolver object.
*
* @param \Drupal\serialization\EntityResolver\EntityResolverInterface[] $resolvers
* The array of concrete resolvers.
*/
public
function
__construct
(
array
$resolvers
=
[])
{
$this
->
resolvers
=
$resolvers
;
}
/**
* {@inheritdoc}
*/
public
function
addResolver
(
EntityResolverInterface
$resolver
)
{
$this
->
resolvers
[]
=
$resolver
;
}
/**
* {@inheritdoc}
*/
public
function
resolve
(
NormalizerInterface
$normalizer
,
$data
,
$entity_type
)
{
foreach
(
$this
->
resolvers
as
$resolver
)
{
$resolved
=
$resolver
->
resolve
(
$normalizer
,
$data
,
$entity_type
);
if
(
isset
(
$resolved
))
{
return
$resolved
;
}
}
}
}
Loading