PHP Class Stevebauman\Location\Drivers\Driver

Show file Open project: stevebauman/location Class Usage Examples

Protected Properties

Property Type Description
$fallback Driver The fallback driver.

Public Methods

Method Description
fallback ( Driver $handler ) Append a fallback driver to the end of the chain.
get ( string $ip ) : Position | boolean Handle the driver request.

Protected Methods

Method Description
hydrate ( Position $position, Illuminate\Support\Fluent $location ) : Position Hydrates the position with the given location instance using the drivers array map.
process ( string $ip ) : Illuminate\Support\Fluent | boolean Process the specified driver.
url ( ) : string Returns the URL to use for querying the current driver.

Method Details

fallback() public method

Append a fallback driver to the end of the chain.
public fallback ( Driver $handler )
$handler Driver

get() public method

Handle the driver request.
public get ( string $ip ) : Position | boolean
$ip string
return Stevebauman\Location\Position | boolean

hydrate() abstract protected method

Hydrates the position with the given location instance using the drivers array map.
abstract protected hydrate ( Position $position, Illuminate\Support\Fluent $location ) : Position
$position Stevebauman\Location\Position
$location Illuminate\Support\Fluent
return Stevebauman\Location\Position

process() abstract protected method

Process the specified driver.
abstract protected process ( string $ip ) : Illuminate\Support\Fluent | boolean
$ip string
return Illuminate\Support\Fluent | boolean

url() abstract protected method

Returns the URL to use for querying the current driver.
abstract protected url ( ) : string
return string

Property Details

$fallback protected property

The fallback driver.
protected Driver,Stevebauman\Location\Drivers $fallback
return Driver