Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

TownInfo Class Reference

List of all members.

Detailed Description

Class to change town information.

The TownInfo class provides functions to access town information.

With get() get data of a specific town id - and use getTowns() to get all towns of a user. With set() you can set town information of an existing town.

Author:
Robert Vock <smir@andaloria.de>

Definition at line 28 of file lib/towninfo.php.

Public Member Functions

 TownInfo (&$oDB, &$oLog)
 constructor.
 add ($x, $y, $strName=', $intPlayer=1, $strInfos=', $intTownhall=0, $intSight=0)
 add a town, all parameters except x and y are optional
 get ($x, $y)
 get a town by coords
 getById ($intTownId=0)
 get infos for a town
 getTowns ($intPlayerId, $intNoTown=0)
 get towns of a user
 set ($intTownId, $strName, $intPlayer=-1, $intSight=-1, $intTownhall=-1, $strInfos=-1, $booPrepend=false)
 update infos for a town
 delete ($intTown, $x, $y)
 delete a town by id

Public Attributes

 $oDB
 DB object.
 $oLog
 Log object.


Constructor & Destructor Documentation

TownInfo::TownInfo &$  oDB,
&$  oLog
 

constructor.

set the objects

Parameters:
$oDB reference to database object
$oLog reference to logger object

Definition at line 39 of file lib/towninfo.php.

References $oDB, and $oLog.


Member Function Documentation

TownInfo::add x,
y,
strName = ',
intPlayer = 1,
strInfos = ',
intTownhall = 0,
intSight = 0
 

add a town, all parameters except x and y are optional

Parameters:
$x x-coordinate of the town
$y y-coordinate of the town
$strName name of the town
$intPlayer player id
$strInfos towninfos
$intTownhall has the town a townhall (is it takable)
$intSight how far can the town see
Returns:
int - the new town_id or false

Definition at line 57 of file lib/towninfo.php.

TownInfo::delete intTown,
x,
y
 

delete a town by id

Parameters:
$intTown 
$x the x coordinate of the town
$y the y coordinate of the town

Definition at line 162 of file lib/towninfo.php.

TownInfo::get x,
y
 

get a town by coords

Parameters:
$x x-coordinate
$y y-coordinate
Returns:
array with town_id, name and last_update or false, if the town does not exist

Definition at line 70 of file lib/towninfo.php.

References $sqlResult.

TownInfo::getById intTownId = 0  ) 
 

get infos for a town

Parameters:
$intTownId id of the town
Returns:
false or array with town infos

Definition at line 85 of file lib/towninfo.php.

References $aInfo.

TownInfo::getTowns intPlayerId,
intNoTown = 0
 

get towns of a user

Parameters:
$intPlayerId id of this user
$intNoTown id of currently viewed town, which will not be returned (optional)
Returns:
array

Definition at line 108 of file lib/towninfo.php.

References $aRow.

TownInfo::set intTownId,
strName,
intPlayer = -1,
intSight = -1,
intTownhall = -1,
strInfos = -1,
booPrepend = false
 

update infos for a town

Parameters:
$intTownId id of this town
$strName new name for the town
$intPlayer the new player_id or -1 for no update
$intSight the sight of the town or -1 for no update
$intTownhall has the town a townhall or -1 for no update
$strInfos new infos for the town or -1 for no update
$booPrepend if set to true, old infos will be appended to $strInfo

Definition at line 130 of file lib/towninfo.php.

References $intPlayer, and $intSight.


Member Data Documentation

TownInfo::$oDB
 

DB object.

Definition at line 30 of file lib/towninfo.php.

Referenced by TownInfo().

TownInfo::$oLog
 

Log object.

Definition at line 31 of file lib/towninfo.php.

Referenced by TownInfo().


The documentation for this class was generated from the following file:
Generated on Sun May 8 19:29:46 2005 for PhpMap by  doxygen 1.4.2