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

Public Member Functions

 __construct ()
 
 load_game_from_db ($id)
 Loads game data from the database. More...
 
 save_game_to_db ()
 Saves game data in the database. More...
 
 get_block ()
 Returns the attribute $block of this object. More...
 
 get_id ()
 Returns the attribute $gameid of this object. More...
 
 get_time_start ()
 Returns the attribute $time_start of this object. More...
 
 get_time_act ()
 Returns the attribute $time_act of this object. More...
 
 get_points ()
 Returns the attribute $points of this object. More...
 
 get_team ()
 Returns the attribute $team of this object. More...
 
 get_active ()
 Returns the attribute $active of this object. More...
 
 get_finished ()
 Returns the attribute $finished of this object. More...
 
 get_highlight ()
 Returns the attribute $highlight of this object. More...
 
 set_time_start ($tmp)
 Set starting time. More...
 
 set_time_act ($tmp)
 Set actual starting time. More...
 
 set_block ($tmp)
 Set block number. More...
 
 set_points ($tmp)
 Set points. More...
 
 set_team ()
 Set the ID of the team for this game. More...
 
 set_active ($tmp)
 Set active status. More...
 
 set_finished ($tmp)
 Set finished status. More...
 
 set_highlight ($tmp)
 Set highlight status. More...
 

Public Attributes

 $block
 
 $time_start
 
 $time_act
 
 $points
 
 $teamid
 
 $active
 
 $finished
 
 $highlight
 

Constructor & Destructor Documentation

Game::__construct ( )

Member Function Documentation

Game::get_active ( )

Returns the attribute $active of this object.

Game::get_block ( )

Returns the attribute $block of this object.

Game::get_finished ( )

Returns the attribute $finished of this object.

Game::get_highlight ( )

Returns the attribute $highlight of this object.

Game::get_id ( )

Returns the attribute $gameid of this object.

Game::get_points ( )

Returns the attribute $points of this object.

Game::get_team ( )

Returns the attribute $team of this object.

Game::get_time_act ( )

Returns the attribute $time_act of this object.

Game::get_time_start ( )

Returns the attribute $time_start of this object.

Game::load_game_from_db (   $id)

Loads game 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 game 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 game 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)

Game::save_game_to_db ( )

Saves game 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 game with the same ID already exists in the database -> The function updates the values in the database.
  • if no game 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
  • updated a existing entry in the database

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

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

Set active status.

Returns false if $tmp is not of type boolean.

Returns true when active was set successfully.

Game::set_block (   $tmp)

Set block number.

Returns false if $tmp is not of type integer.

Returns true when block was set successfully.

Game::set_finished (   $tmp)

Set finished status.

Returns false if $tmp is not of type boolean.

Returns true when finished was set successfully.

Game::set_highlight (   $tmp)

Set highlight status.

Returns false if $tmp is not of type boolean.

Returns true when highlight was set successfully.

Game::set_points (   $tmp)

Set points.

Returns false if $tmp is not of type integer.

Returns true when points were set successfully.

Game::set_team ( )

Set the ID of the team for this game.

Returns false if $tmp is not of type integer.

Returns true when team was set successfully.

Game::set_time_act (   $tmp)

Set actual starting time.

Returns false if $tmp is not of type integer.

Returns true when actual starting time was set successfully.

Game::set_time_start (   $tmp)

Set starting time.

Returns false if $tmp is not of type integer.

Returns true when starting time was set successfully.

Member Data Documentation

Game::$active
Game::$block
Game::$finished
Game::$highlight
Game::$points
Game::$teamid
Game::$time_act
Game::$time_start

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