Waypoint Class

This class is contained in the file Waypoint.inc.php and encapsulates a single Waypoint. Each geocache has at least one waypoint - the geocache itself. Multi- or puzzle/mystery caches have at least two waypoints. Each cache may also contain one ore more "parking waypoints" describing coordinates near the cache where the geocacher can park his car.

free

Context: Waypoint

Cleanup function
Clears all attribute values, useful for recycling a Waypoint instance.

Usage
$waypoint->free()

getChangeDate

Context: Waypoint

Getter function
Returns the timestamp of the date when this waypoint was last modified in the database or 0.

Usage
$var=$waypoint->getChangeDate()

getCoordinates

Context: Waypoint

Returns this waypoints´ coordinates
Returns the coordinates as an array.

Return value
array($longitude, $latitude)

Usage
$waypoint->getCoordinates()

getDescription

Context: Waypoint

Getter method
Returns this waypoints´ description.

Return value
string

Usage
$waypoint->getDescription()

getHint

Context: Waypoint

Getter method
Returns this waypoints´ hint text.

Return value
string

Usage
$waypoint->getHint()

getInsertDate

Context: Waypoint

Getter function
Returns the timestamp of the date when this waypoint was added to the database.

Usage
$var=$waypoint->getInsertDate()

getName

Context: Waypoint

Getter method
Returns this waypoints´ name (6 characters maximum, only A-Z and 0-9).

Return value
string

Usage
$waypoint->getName()

getPointType

Context: Waypoint

Getter method
Returns this waypoints´ point type.

Return value
One of "parking", "puzzle" and "cache"

Usage
$waypoint->getPointType()

getPublic

Context: Waypoint

Getter method
Returns whether this waypoints´ coordinates can be made public. Each station of a multi cache or puzzle cache should return false here. Always remember: although these coordinates should not be made public, they must be stored somewhere.

Return value
bool

Usage
$waypoint->getPublic()

getTitle

Context: Waypoint

Getter method
Returns whether this waypoints´ title.

Return value
string

Usage
$waypoint->getTitle()

getUserID

Context: Waypoint

Getter method
Returns the userID this waypoint belongs to. If you´re not using a user management this will always return 0.

Usage
$userID=$waypoint->getUserID()

setChangeDate

Context: Waypoint

Setter method
Sets the change_date value of this waypoint to the timestamp given

Usage
$waypoint->setChangeDate($timestamp)

setChangeIP

Context: Waypoint

Setter method
Sets the IP which was used to modify this waypoint.

Usage
$waypoint->setChangeIP('10.10.10.10')

setCoordinates

Context: Waypoint

Setter method
Sets this waypoints´ coordinates. Returns true on success, false otherwise.

$longitude and $latitude are to be given as parameters.

Return value
bool

Usage
$waypoint->setCoordinates($longitude, $latitude)

setDescription

Context: Waypoint

Setter method
Sets this waypoints´ description.

Usage
$waypoint->setDescription($string)

setHint

Context: Waypoint

Setter method
Sets this waypoints´ hint text.

Usage
$waypoint->setHint($string)

setInsertDate

Context: Waypoint

Setter method
Sets the date (as a UNIX timestamp) when this waypoint was added to the database.

Usage
$waypoint->setInsertDate(mktime())

setName

Context: Waypoint

Setter method
Sets this waypoints´ name (6 characters max, only A-Z and 0-9). Returns true on success, false otherwise.

Return value
bool

Usage
$waypoint->setHint($string)

setPointType

Context: Waypoint

Setter method
Sets this waypoints´ point type ("parking", "puzzle" or "cache"). Returns true on success, false otherwise.

Return value
bool

Usage
$waypoint->setPointType($string)

setPublic

Context: Waypoint

Setter method
Sets this waypoints´ "public" value, i.e. if the coordinates of this waypoint may be displayed to the geocacher directly. This is normally true, except when using multi caches and puzzle caches where the user has to do certain things to get the coordinates of the next station. In this case the longitude and latitude values of this Waypoint must contain the real coordinates.

Usage
$waypoint->setPublic(true)

setTitle

Context: Waypoint

Setter method
Sets this waypoints´ title.

Usage
$waypoint->setTitle($string)

setUserID

Context: Waypoint

Setter method
Sets the userID of the user this waypoint belongs to. Unless you are using a user management this function may not be heloful to you.

Usage
$waypoint->setUserID(213)

PHPGeocache  -  Geocaching  with  PHP