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

Class: Net_GeoIP_Location

Source Location: /Net_GeoIP-1.0.0/Net/GeoIP/Location.php

Class Overview


This class represents a location record as returned by Net_GeoIP::lookupLocation().


Author(s):

Version:

  • $Revision: 296763 $

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 50]
This class represents a location record as returned by Net_GeoIP::lookupLocation().

This class is primarily a collection of values (the public properties of the class), but there is also a distance() method to calculate the km distance between two points.



[ Top ]


Class Variables

$aData = array(
        'countryCode'  => null,
        'countryCode3' => null,
        'countryName'  => null,
        'region'       => null,
        'city'         => null,
        'postalCode'   => null,
        'latitude'     => null,
        'longitude'    => null,
        'areaCode'     => null,
        'dmaCode'      => null
    )

[line 52]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

distance   [line 73]

float distance( Net_GeoIP_Location $loc)

Calculate the distance in km between two points.
  • Return: The number of km between two points on the globe.
  • Access: public

Parameters:

Net_GeoIP_Location   $loc     The other point to which distance will be calculated.

[ Top ]

getData   [line 152]

array getData( )

Getter for $this->aData array
  • Access: public

[ Top ]

serialize   [line 107]

array serialize( )

magic method to make it possible

to store this object in cache when automatic serialization is on Specifically it makes it possible to store this object in memcache

  • Access: public

[ Top ]

set   [line 133]

object set( string $name, string $val)

Setter for elements of $this->aData array
  • Return: object
  • Access: public

Parameters:

string   $name     The variable to set
string   $val     The value

[ Top ]

unserialize   [line 119]

void unserialize( array $serialized)

unserialize a representation of the object
  • Access: public

Parameters:

array   $serialized     The serialized representation of the location

[ Top ]

__get   [line 166]

mixed __get( string $name)

Magic method to get value from $this->aData array
  • Return: string if value exists or null if it is empty of just does not exist
  • Access: public

Parameters:

string   $name     The var to get

[ Top ]

__isset   [line 196]

bool __isset( strign $name)

Magic method makes it possible to check if specific record exists and also makes it possible to use empty() on any property
  • Access: public

Parameters:

strign   $name     The name of the var to check

[ Top ]

__set   [line 142]

void __set( $name, $val)

  • Access: public

Parameters:

   $name     
   $val     

[ Top ]

__toString   [line 181]

string __toString( )

String representation of the object
  • Return: text and result of print_r of $this->aData array
  • Access: public

[ Top ]


Documentation generated on Thu, 12 May 2011 12:30:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.