Skip to content
Snippets Groups Projects
Commit f2b26644 authored by Eirik Morland's avatar Eirik Morland
Browse files

Issue #3356363 by eiriksm: Make it possible to get max repos from a team node

parent 77eac9bb
No related branches found
No related tags found
1 merge request!10Issue #3356363: Make it possible to get max repos from a team node
......@@ -13,6 +13,18 @@ class TeamNode extends Node {
const NODE_TYPE = 'team';
const MEMBERS_FIELD = 'field_team_members';
const ADMIN_FIELD = 'field_team_admins';
const PROJECT_LIMIT_FIELD = 'field_project_limit';
/**
* Get the max private repos a team can have, based on the field value.
*/
public function getMaxPrivateRepos() : int {
$return = 0;
if (!$this->hasField(self::PROJECT_LIMIT_FIELD) || $this->get(self::PROJECT_LIMIT_FIELD)->isEmpty()) {
return $return;
}
return (int) $this->get(self::PROJECT_LIMIT_FIELD)->first()->getString();
}
/**
* Get the team plan.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment