Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
group
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
group
Merge requests
!125
fixed
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
fixed
issue/group-3414592:3414592-creating-a-grouprelationship
into
3.3.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
chetan
requested to merge
issue/group-3414592:3414592-creating-a-grouprelationship
into
3.3.x
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Closes
#3414592
0
0
Merge request reports
Compare
3.3.x
3.3.x (HEAD)
and
latest version
latest version
28d5f132
1 commit,
1 year ago
1 file
+
19
−
13
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Entity/Storage/GroupRelationshipStorage.php
+
19
−
13
Options
@@ -88,23 +88,29 @@ class GroupRelationshipStorage extends SqlContentEntityStorage implements GroupR
$entity_class
=
parent
::
getEntityClass
(
$bundle
);
if
(
$bundle
)
{
$group_relationship_type
=
$this
->
entityTypeManager
->
getStorage
(
'group_relationship_type'
)
->
load
(
$bundle
);
assert
(
$group_relationship_type
instanceof
GroupRelationshipTypeInterface
);
$plugin_id
=
$group_relationship_type
->
getPluginId
();
$group_relation_type
=
$this
->
pluginManager
->
getDefinition
(
$plugin_id
);
assert
(
$group_relation_type
instanceof
GroupRelationTypeInterface
);
if
(
$shared_bundle_class
=
$group_relation_type
->
getSharedBundleClass
())
{
// No specific bundle class, so it's safe to return the shared one.
if
(
$entity_class
===
parent
::
getEntityClass
())
{
return
$shared_bundle_class
;
$group_relationship_type
=
$this
->
entityTypeManager
->
getStorage
(
'group_relationship_type'
)
->
load
(
$bundle
);
if
(
$group_relationship_type
instanceof
GroupRelationshipTypeInterface
)
{
$plugin_id
=
$group_relationship_type
->
getPluginId
();
assert
(
$plugin_id
!==
null
,
'Plugin ID should not be null.'
);
$group_relation_type
=
$this
->
pluginManager
->
getDefinition
(
$plugin_id
);
assert
(
$group_relation_type
instanceof
GroupRelationTypeInterface
);
if
(
$shared_bundle_class
=
$group_relation_type
->
getSharedBundleClass
())
{
// No specific bundle class, so it's safe to return the shared one.
if
(
$entity_class
===
parent
::
getEntityClass
())
{
return
$shared_bundle_class
;
}
}
}
else
{
throw
new
\RuntimeException
(
"Unable to load group_relationship_type entity with bundle '
$bundle
'"
);
}
}
}
return
$entity_class
;
}
}
/**
* {@inheritdoc}
Loading