Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
violinist_teams
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
violinist_teams
Commits
f199e641
Commit
f199e641
authored
1 year ago
by
Eirik Morland
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3358364
by eiriksm: Make it possible to get all projects of a team
parent
1a65e7c7
No related branches found
Branches containing commit
No related tags found
1 merge request
!14
Issue #3358364: Make it possible to get all projects of a team
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TeamManager.php
+19
-0
19 additions, 0 deletions
src/TeamManager.php
with
19 additions
and
0 deletions
src/TeamManager.php
+
19
−
0
View file @
f199e641
...
...
@@ -38,6 +38,25 @@ class TeamManager {
$this
->
state
=
$state
;
}
/**
* Get all the projects of a team.
*
* @return \Drupal\violinist_projects\ProjectNode[]
* An array of project nodes.
*/
public
function
getProjects
(
TeamNode
$node
)
:
array
{
$storage
=
$this
->
entityTypeManager
->
getStorage
(
'node'
);
$nids
=
$storage
->
getQuery
()
// @todo We would have used the constants from the projects module here,
// but we can not depend on that module since that would create a circular
// dependency, really.
->
condition
(
'type'
,
'project'
)
->
condition
(
'field_team'
,
$node
->
id
())
->
execute
();
return
$storage
->
loadMultiple
(
$nids
);
}
/**
* Gets all the teams for a given user.
*
...
...
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