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
cdf421b0
Commit
cdf421b0
authored
1 year ago
by
Eirik Morland
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3360301
: Make it possible to set the plan with a setter
parent
f199e641
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!15
Issue #3360301: Make it possible to set the plan with a setter
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TeamNode.php
+12
-0
12 additions, 0 deletions
src/TeamNode.php
with
12 additions
and
0 deletions
src/TeamNode.php
+
12
−
0
View file @
cdf421b0
...
...
@@ -13,6 +13,7 @@ class TeamNode extends Node {
const
NODE_TYPE
=
'team'
;
const
MEMBERS_FIELD
=
'field_team_members'
;
const
ADMIN_FIELD
=
'field_team_admins'
;
const
PLAN_FIELD
=
'field_plan'
;
const
PROJECT_LIMIT_FIELD
=
'field_project_limit'
;
/**
...
...
@@ -26,6 +27,17 @@ class TeamNode extends Node {
return
(
int
)
$this
->
get
(
self
::
PROJECT_LIMIT_FIELD
)
->
first
()
->
getString
();
}
/**
* Setter for the plan.
*/
public
function
setPlan
(
$plan
)
:
void
{
if
(
!
$this
->
hasField
(
self
::
PLAN_FIELD
))
{
throw
new
\RuntimeException
(
'The plan field is not present on the team node'
);
}
// @todo Some validation of what plans we are setting, probably?
$this
->
get
(
self
::
PLAN_FIELD
)
->
setValue
(
$plan
);
}
/**
* Get the team plan.
*/
...
...
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