Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inline_entity_form
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
inline_entity_form
Merge requests
!112
Don't throw needless exception
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Don't throw needless exception
issue/inline_entity_form-3443667:3443667-no-exception
into
3.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
Claudiu Cristea
requested to merge
issue/inline_entity_form-3443667:3443667-no-exception
into
3.x
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Closes
#3443667
0
0
Merge request reports
Compare
3.x
3.x (HEAD)
and
latest version
latest version
9382d0a3
1 commit,
1 year ago
1 file
+
3
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/ReferenceUpgrader.php
+
3
−
9
Options
@@ -29,15 +29,9 @@ final class ReferenceUpgrader {
* Registers entities.
*/
public
function
registerEntity
(
EntityInterface
$entity
)
{
$entityId
=
$entity
->
id
()
??
$this
->
throwNeedsId
();
$this
->
entities
[
$entity
->
getEntityTypeId
()][
$entityId
]
=
$entity
;
}
/**
* Throws exceptions on trying to register entities without id.
*/
private
function
throwNeedsId
()
{
throw
new
\RuntimeException
(
"Can only register entity with ID."
);
if
(
$entityId
=
$entity
->
id
())
{
$this
->
entities
[
$entity
->
getEntityTypeId
()][
$entityId
]
=
$entity
;
}
}
/**
Loading