Team
class Team extends AvatarModel implements TeamInterface, DuplexUrlInterface
A league team
Constants
| TABLE | 
                     The name of the database table used for queries  | 
            
| AVATAR_LOCATION | 
                     The location where avatars will be stored  | 
            
| CREATE_PERMISSION | 
                     
  | 
            
| EDIT_PERMISSION | 
                     
  | 
            
| SOFT_DELETE_PERMISSION | 
                     
  | 
            
| HARD_DELETE_PERMISSION | 
                     
  | 
            
Properties
| static Match[]|null | $cachedMatches | A list of cached matches to calculate team activity | 
Methods
Adds a new member to the team
Increase or decrease the ELO of the team
Change the ELO of the team
Increment the team's match count
Decrement the team's match count by one
Get the activity of the team
Get the creation date of the team
Get the description of the team
Get the current elo of the team
Get the matches this team has participated in
Get the number of matches that resulted as a draw
Get the number of matches that the team has lost
Get the URL that points to the team's list of matches
Get the number of matches that the team has won
Get the members on the team
Get the name of the team
Get the name of the team, safe for use in your HTML
Get the number of members on the team
Get the total number of matches this team has played
Get the rank category a team belongs too based on their ELO
Get the HTML for an image with the rank symbol
Increment the team's match count by one
Check if a player is part of this team
Removes a member from the team
Update the description of the team
Delete the object
Create a new team
Get a single team by its name
Alphabetical order function for use in usort (case-insensitive)
Get the possible statuses representing an active model (visible to everyone)
Get a query builder for teams
Details
        at line         line 145
                            bool|null
    addMember(int $id)
        
    
    Adds a new member to the team
        at line         line 162
                            
    changeElo(int $adjust)
        
    
    Increase or decrease the ELO of the team
        at line         line 173
                            
    setElo(int $elo)
        
    
    Change the ELO of the team
        at line         line 184
                            
    changeMatchCount(int $adjust, string $type)
        
    
    Increment the team's match count
        at line         line 211
                            
    decrementMatchCount(string $type)
        
    
    Decrement the team's match count by one
        at line         line 221
                            float
    getActivity()
        
    
    Get the activity of the team
        at line         line 249
                            TimeDate
    getCreationDate()
        
    
    Get the creation date of the team
        at line         line 259
                            string
    getDescription()
        
    
    Get the description of the team
        at line         line 269
                            int
    getElo()
        
    
    Get the current elo of the team
        at line         line 279
                            Player
    getLeader()
        
    
    Get the leader of the team
        at line         line 293
                            Match[]
    getMatches(string $matchType = 'all', int $count = 5, int $page = 1)
        
    
    Get the matches this team has participated in
        at line         line 308
                            int
    getMatchesDraw()
        
    
    Get the number of matches that resulted as a draw
        at line         line 318
                            int
    getMatchesLost()
        
    
    Get the number of matches that the team has lost
        at line         line 328
                            string
    getMatchesURL()
        
    
    Get the URL that points to the team's list of matches
        at line         line 338
                            int
    getMatchesWon()
        
    
    Get the number of matches that the team has won
        at line         line 348
                            Player[]
    getMembers()
        
    
    Get the members on the team
        at line         line 376
                            string
    getName()
        
    
    Get the name of the team
        at line         line 389
                            string
    getEscapedName()
        
    
    Get the name of the team, safe for use in your HTML
        at line         line 402
                            int
    getNumMembers()
        
    
    Get the number of members on the team
        at line         line 412
                            int
    getNumTotalMatches()
        
    
    Get the total number of matches this team has played
        at line         line 424
                            int
    getRankValue()
        
    
    Get the rank category a team belongs too based on their ELO
This value is always a multiple of 100 and less than or equal to 2000
        at line         line 434
                            string
    getRankImageLiteral()
        
    
    Get the HTML for an image with the rank symbol
        at line         line 444
                            
    incrementMatchCount(string $type)
        
    
    Increment the team's match count by one
        at line         line 456
                            bool
    isMember(int $playerID)
        
    
    Check if a player is part of this team
        at line         line 469
                            void
    removeMember(int $id)
        
    
    Removes a member from the team
        at line         line 487
                            void
    setDescription(string $description)
        
    
    Update the description of the team
        at line         line 498
                            Team
    setStatus(string $newStatus)
        
    
    Change the status of the team
        at line         line 509
                            Team
    setLeader(int $leader)
        
    
    Change the leader of the team
        at line         line 520
                            bool
    isLastMatch(int|Match $match)
        
    
    Find if a specific match is the team's last one
        at line         line 533
                            void
    delete()
        
    
    Delete the object
Please note that this does not delete the object entirely from the database, it only hides it from users. You should overload this function if your object does not have a 'status' column which can be set to 'deleted'.
        at line         line 555
                static            Team
    createTeam(string $name, int $leader, string $avatar, string $description, string $status = 'closed', string|TimeDate $created = 'now')
        
    
    Create a new team
        at line         line 586
                static            Team[]
    getTeams()
        
    
    Get all the teams in the database that are not disabled or deleted
        at line         line 602
                static            Team
    getFromName(string $name)
        
    
    Get a single team by its name
        at line         line 613
                static            Closure
    getAlphabeticalSort()
        
    
    Alphabetical order function for use in usort (case-insensitive)
        at line         line 623
                static            string[]
    getActiveStatuses()
        
    
    Get the possible statuses representing an active model (visible to everyone)
        at line         line 632
                static            QueryBuilder
    getQueryBuilder()
        
    
    Get a query builder for teams