phpgeocache
[ class tree: phpgeocache ] [ index: phpgeocache ] [ all elements ]

Class: PHPGeocache

Source Location: /PHPGeocache.inc.php

Class Overview


Defines the PHPGeocache class.


Variables

Methods



Class Details

[line 62]
Defines the PHPGeocache class.



[ Top ]


Class Variables

$lang =

[line 78]

The language.



Tags:

since:  1.0
access:  public

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 99]

PHPGeocache __construct( )

The PHP5 constructor.

Automatically includes the correct GeocacheDB file from the constant PHPGEOCACHE_DB_TYPE.




Tags:

since:  1.0


[ Top ]

constructor PHPGeocache [line 87]

PHPGeocache PHPGeocache( )

The PHP4 constructor



Tags:

see:  PHPGeocache::__construct()
since:  1.0


[ Top ]

method addCacheToDB [line 288]

integer|bool addCacheToDB( &$geocache, [int $userID = 0], [string $initialStatus = 'RUN'], object $geocache)

Accepts only a Geocache object as a parameter and inserts that geocache object into the database.

The function returns the cache_id of the caches table.




Tags:

todo:  Add commit and rollback via transactions when a waypoint cannot be added correctly
since:  1.0


Parameters:

object   $geocache   A Geocache object
int   $userID   The userID this cache is assigned to (if any)
string   $initialStatus   The initial status in the database, can be one of 'RUN','PENDING','HOLD','ARCHIVED','DELETE'
   &$geocache  

[ Top ]

method findCaches [line 236]

array|bool findCaches( string $searchString, [bool $searchTitle = true], [bool $searchDescription = true], [bool $onlyActive = true])

Finds caches by searching in both the title and description fields.

Returns multiple entries.




Tags:

since:  1.0


Parameters:

string   $searchString   The string to be searched for
bool   $searchTitle   Whether to search in the title
bool   $searchDescription   Whether to search in the description
bool   $onlyActive   Whether only active caches should be returned

[ Top ]

method getCacheByID [line 179]

array|bool getCacheByID( integer $cacheID, [bool $onlyActive = true])

Returns a cache object by the cache_id field value of the caches table given.



Tags:

since:  1.0


Parameters:

integer   $cacheID   The value of the cache_id field of the value to be returned.
bool   $onlyActive   Whether only active caches should be returned

[ Top ]

method getCacheByName [line 206]

array|bool getCacheByName( string $name, [bool $onlyActive = true])

Returns a cache object by the name field value of the caches table given.



Tags:

since:  1.0


Parameters:

string   $name   The value of the name field of the value to be returned.
bool   $onlyActive   Whether only active caches should be returned

[ Top ]

method getCachesByDistance [line 130]

array|bool getCachesByDistance( float $long, $lat, integer $maxCount, [float $radius = 9999], [bool $onlyActive = true], [bool $withWaypoints = false], [array $getOnlyTheseFields = array()], float $lat1)

Returns an array of Geocache objects sorted by distance to the location provided.

The original SQL statement code has been created by boomtrek@hotmail.com and has been modified below.




Tags:



Parameters:

float   $long   The longitude of the location to be used as the center for the radius
float   $lat1   The latitude of the location to be used as the center for the radius
integer   $maxCount   The maximum number of results to return
float   $radius   The radius in km to be used for the search, defaults to 9999km
bool   $onlyActive   Whether only active caches should be returned
bool   $withWaypoints   Settings this to true also returns the waypoints within each geocache object. Defaults to false.
array   $getOnlyTheseFields   An array of database fields of the caches table. If not given, all fields will be used.
   $lat  

[ Top ]

method setErrorMode [line 383]

void setErrorMode( bool $showError, bool $logError)

Sets the error mode, whether errors should be displayed or logged or both.



Tags:

since:  1.0


Parameters:

bool   $showError   Whether to display the error text on the website (please use this only for debugging)
bool   $logError   Whether to log the error to the webserver error log

[ Top ]


Documentation generated on Mon, 29 May 2006 19:21:50 +0200 by phpDocumentor 1.3.0RC6