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

Public Member Functions

 __construct ()
 Constructor of a Team object. Sets all private variables to 0, "" or true (active). More...
 
 load_team_from_db ($id)
 Loads team data from the database. More...
 
 save_team_to_db ()
 Saves team data in the database. More...
 
 get_id ()
 Returns the attribute $teamid of this object. More...
 
 get_teamleader ()
 Returns the attribute $teamleader of this object. More...
 
 get_points ()
 Returns the attribute $points of this object. More...
 
 get_robot ()
 Returns the attribute $robot of this object. More...
 
 get_name ()
 Returns the attribute $name of this object. More...
 
 get_position ()
 Returns the attribute $position of this object. More...
 
 get_active ()
 Returns the attribute $active of this object. More...
 
 set_teamleader ($tmp)
 Sets $teamleader of this object to $tmp. More...
 
 set_points ($tmp)
 Sets $points of this object to $tmp. More...
 
 set_robot ($tmp)
 Sets $robot of this object to $tmp. More...
 
 set_name ($tmp)
 Sets $name of this object to $tmp. More...
 
 set_position ($tmp)
 Sets $position of this object to $tmp. More...
 
 set_active ($tmp)
 Sets $active of this object to $tmp. More...
 

Constructor & Destructor Documentation

Team::__construct ( )

Constructor of a Team object. Sets all private variables to 0, "" or true (active).

Member Function Documentation

Team::get_active ( )

Returns the attribute $active of this object.

Team::get_id ( )

Returns the attribute $teamid of this object.

Team::get_name ( )

Returns the attribute $name of this object.

Team::get_points ( )

Returns the attribute $points of this object.

Team::get_position ( )

Returns the attribute $position of this object.

Team::get_robot ( )

Returns the attribute $robot of this object.

Team::get_teamleader ( )

Returns the attribute $teamleader of this object.

Team::load_team_from_db (   $id)

Loads team data from the database.

This function sends a sql request to the linked database (specified in the settings.ini file) to get the data of the team with the ID $id. The data is safed in the private attributes.

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

  • $id is not an integer
  • no data for a team with ID: $id ; was found in the database
  • more than one entry with ID: $id ; was found in the database

Returns 'true' if there were no errors

'false'-outputs will be logged (if enabled in the settings.ini file)

Team::save_team_to_db ( )

Saves team data in the database.

This function sends a sql request to the linked database (specified in the settings.ini file) to safe the objects private attributes in the database.

There are two possible uses for this function:

  • if a team with the same ID already exists in the database -> The function updates the values in the database.
  • if no team with the same ID exists -> The function creates a new entry in the database and updates the ID (also of the object) Use with care, is you may have to manually delete wrong inputs in your database

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

  • created a new entry in the database
  • u pdated a existing entry in the database

Returns 'false' in all other cases. For example:

  • if two teams with the same ID exists (look for the checks!)
  • if a team with ID = 0 exists (it should not be the case, but you never know)
Team::set_active (   $tmp)

Sets $active of this object to $tmp.

Returns 'false' if $tmp is not of type integer (as 0 is interpreted as false and all other numbers as true) or boolean. Returns 'true' else.

Team::set_name (   $tmp)

Sets $name of this object to $tmp.

Returns 'false' if $tmp is not of type string. Returns 'true' else.

Team::set_points (   $tmp)

Sets $points of this object to $tmp.

Returns 'false' if $tmp is not of type integer. Returns 'true' else.

Team::set_position (   $tmp)

Sets $position of this object to $tmp.

Returns 'false' if $tmp is not of type integer. Returns 'true' else.

Team::set_robot (   $tmp)

Sets $robot of this object to $tmp.

Returns 'false' if $tmp is not of type string. Returns 'true' else.

Team::set_teamleader (   $tmp)

Sets $teamleader of this object to $tmp.

Returns 'false' if $tmp is not of type string. Returns 'true' else.


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