PHP Class KamranAhmed\Geocode\Location

Represents the location details obtained from the Geocoding Service
ファイルを表示 Open project: kamranahmedse/php-geocode

Public Methods

Method Description
__construct ( string $address, stdClass $dataFromService ) Create a new Location object
getAddress ( string $default = '' ) : string Gets the address
getCountry ( string $default = '' ) : string Gets the country of the location
getDistrict ( string $default = '' ) : string Gets the district of the location
getLatitude ( string $default = '' ) : string Gets the latitude of the location
getLocality ( string $default = '' ) : string Gets the locality of the location
getLongitude ( string $default = '' ) : string Gets the longitude of the location
getPostcode ( string $default = '' ) : string Gets the post code for the location
getStreetAddress ( string $default = '' ) : string Gets the street address
getStreetNumber ( string $default = '' ) : string Gets the street number for the location
getTown ( string $default = '' ) : string Gets the town for the location
isValid ( ) : boolean Checks whether the data passed to the class was valid

Private Methods

Method Description
populateDetail ( stdClass $locationDetail ) : boolean Populates the object with the detail from the service

Method Details

__construct() public method

Create a new Location object
public __construct ( string $address, stdClass $dataFromService )
$address string Address whose detail it is
$dataFromService stdClass The data retrieved from the Geocoding service

getAddress() public method

Gets the address
public getAddress ( string $default = '' ) : string
$default string
return string

getCountry() public method

Gets the country of the location
public getCountry ( string $default = '' ) : string
$default string
return string

getDistrict() public method

Gets the district of the location
public getDistrict ( string $default = '' ) : string
$default string
return string

getLatitude() public method

Gets the latitude of the location
public getLatitude ( string $default = '' ) : string
$default string
return string

getLocality() public method

Gets the locality of the location
public getLocality ( string $default = '' ) : string
$default string
return string

getLongitude() public method

Gets the longitude of the location
public getLongitude ( string $default = '' ) : string
$default string
return string

getPostcode() public method

Gets the post code for the location
public getPostcode ( string $default = '' ) : string
$default string
return string

getStreetAddress() public method

Gets the street address
public getStreetAddress ( string $default = '' ) : string
$default string
return string

getStreetNumber() public method

Gets the street number for the location
public getStreetNumber ( string $default = '' ) : string
$default string
return string

getTown() public method

Gets the town for the location
public getTown ( string $default = '' ) : string
$default string
return string

isValid() public method

Checks whether the data passed to the class was valid
public isValid ( ) : boolean
return boolean True if the data is valid and false otherwise