Automatische Punkteauswertung des RoboSAX  0.0.1
Public Member Functions | Public Attributes | List of all members
Teams Class Reference

Public Member Functions

 __construct ()
 Constructor of Teams objects. More...
 
 add_team ($nt)
 Adds the transmitted object of type Team to tms. More...
 
 remove_team ($id)
 Removes the team object with the ID $id from $tms. More...
 
 load_teams_from_db ()
 Loads all teams from the database. More...
 
 save_teams_to_db ()
 Saves the data inside $tms in the database. More...
 
 get_team_by_id ($tmp)
 Returns a Team object with the ID $tmp. More...
 
 order_teams_by_points ()
 Orders $tms [desc] by points of the Team objects. More...
 
 order_teams_by_id ()
 Orders $tms [asc] by teamid of the Team objects. More...
 

Public Attributes

 $tms = []
 

Constructor & Destructor Documentation

Teams::__construct ( )

Constructor of Teams objects.

Sets $tms to an empty array and $AnzTeams to 0.

Member Function Documentation

Teams::add_team (   $nt)

Adds the transmitted object of type Team to tms.

Returns 'false' if one of the following events occures:

  • $nt is not an object of class Team.
  • ID of $nt isn't unique in $tms.

Returns 'true' if the integration of the transmitted object was successfully.

If the ID of $nt is zero, it will change automaticly to size of $tms + 1.

Teams::get_team_by_id (   $tmp)

Returns a Team object with the ID $tmp.

This function searches $tms for a Team object with the teamid $tmp and, if found, returns it.

Returns an empty Team object, if no Team object with the teamid $tmp exists in $tms.

Teams::load_teams_from_db ( )

Loads all teams from the database.

This function uses the load_team_from_db($id) function of a Team object, to load all teams from the database.

Returns 'false' if one of the following events occure:

  • no data was found in the database.
  • load_team_from_db($id) returned false.

Returns 'true' if all teams were loaded successfully.

Teams::order_teams_by_id ( )

Orders $tms [asc] by teamid of the Team objects.

Teams::order_teams_by_points ( )

Orders $tms [desc] by points of the Team objects.

Teams::remove_team (   $id)

Removes the team object with the ID $id from $tms.

Returns 'true' if an object was successfully deleted from $tms.

Returns 'false' if either:

  • $id is not of type integer or
  • no object with the transmitted ID exists in $tms.
Teams::save_teams_to_db ( )

Saves the data inside $tms in the database.

This function uses the save_team_to_db() function of a Team object in a loop to save the data inside of $tms.

Returns 'false' if save_team_to_db() returns false.

Returns 'true' if the data could be saved to the database successfully.

Member Data Documentation

Teams::$tms = []

The documentation for this class was generated from the following file: