abstract class Manager

Location Manager Class

Traits

Adds event related features to any class.

Properties

protected array $emitterSingleEvents from  EventEmitter
protected array $emitterEvents from  EventEmitter
protected array $emitterEventSorted from  EventEmitter
protected $sessionKey
protected AbstractLocation $model
protected $defaultLocation
protected $locationModel
protected $loaded
static protected $schedulesCache
static protected Closure $locationSlugResolver

The route parameter resolver callback.

Methods

bindEvent(string $event, callable $callback, int $priority = 0)

Create a new event binding.

bindEventOnce(string $event, callable $callback)

Create a new event binding that fires once only

void
emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

unbindEvent(string $event = null)

Destroys an event binding.

string|array
fireEvent(string $event, array $params = [], bool $halt = false)

Fire an event and call the listeners.

mixed
fireSystemEvent(string $event, array $params = [], bool $halt = true)

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

instance()

Helper to get the current location instance.

string
resolveLocationSlug()

Resolve the location slug from route parameter.

void
locationSlugResolver(Closure $resolver)

Set the location route parameter resolver callback.

mixed
getDefaultLocation()

No description

setDefaultLocation(string $defaultLocation)

No description

getDefault()

No description

current()

No description

setCurrent(LocationInterface $locationModel)

No description

getModel()

No description

setModel(LocationInterface $model)

No description

setModelById($id)

No description

setModelClass($className)

No description

createLocationModel()

Creates a new instance of the location model

createLocationModelQuery()

Prepares a query derived from the location model.

void
extendLocationQuery(Builder $query)

Extend the query used for finding the location.

getById(mixed $identifier)

Retrieve a location by their unique identifier.

getBySlug(string $slug)

Retrieve a location by their unique slug.

searchByCoordinates(CoordinatesInterface $coordinates, $limit = 20)

No description

workingSchedule($type, null $days = null)

No description

mixed
getSession(string $key = null, string $default = null)

Retrieves key/value pair from session data.

putSession($key, $value)

No description

forgetSession($key = null)

No description

Details

in EventEmitter at line 36
EventEmitter bindEvent(string $event, callable $callback, int $priority = 0)

Create a new event binding.

Parameters

string $event

The event name to listen for

callable $callback

The callback to call when emitted

int $priority

Return Value

EventEmitter

in EventEmitter at line 52
EventEmitter bindEventOnce(string $event, callable $callback)

Create a new event binding that fires once only

Parameters

string $event

The event name

callable $callback

Return Value

EventEmitter

in EventEmitter at line 66
protected void emitterEventSortEvents(string $eventName)

Sort the listeners for a given event by priority.

Parameters

string $eventName

Return Value

void

in EventEmitter at line 84
EventEmitter unbindEvent(string $event = null)

Destroys an event binding.

Parameters

string $event

Event to destroy

Return Value

EventEmitter

in EventEmitter at line 124
string|array fireEvent(string $event, array $params = [], bool $halt = false)

Fire an event and call the listeners.

Parameters

string $event

Event name

array $params

Event parameters

bool $halt

Halt after first non-null result

Return Value

string|array

Collection of event results / Or single result (if halted)

in EventEmitter at line 178
mixed fireSystemEvent(string $event, array $params = [], bool $halt = true)

Fires a combination of local and global events. The first segment is removed from the event name locally and the local object is passed as the first argument to the event globally. Halting is also enabled by default.

For example:

$this->fireSystemEvent('admin.form.myEvent', ['my value']);

Is equivalent to:

$this->fireEvent('form.myEvent', ['myvalue'], true);

Event::fire('admin.form.myEvent', [$this, 'myvalue'], true);

Parameters

string $event

Event name

array $params

Event parameters

bool $halt

Halt after first non-null result

Return Value

mixed

at line 44
Manager instance()

Helper to get the current location instance.

Return Value

Manager

at line 54
string resolveLocationSlug()

Resolve the location slug from route parameter.

Return Value

string

at line 67
void locationSlugResolver(Closure $resolver)

Set the location route parameter resolver callback.

Parameters

Closure $resolver

Return Value

void

at line 75
mixed getDefaultLocation()

No description

Return Value

mixed

at line 83
setDefaultLocation(string $defaultLocation)

No description

Parameters

string $defaultLocation

at line 88
getDefault()

No description

at line 93
current()

No description

at line 117
setCurrent(LocationInterface $locationModel)

No description

Parameters

LocationInterface $locationModel

at line 126
getModel()

No description

at line 135
setModel(LocationInterface $model)

No description

Parameters

LocationInterface $model

at line 142
setModelById($id)

No description

Parameters

$id

at line 149
setModelClass($className)

No description

Parameters

$className

at line 158
AbstractLocation createLocationModel()

Creates a new instance of the location model

Return Value

AbstractLocation

at line 169
protected createLocationModelQuery()

Prepares a query derived from the location model.

at line 185
void extendLocationQuery(Builder $query)

Extend the query used for finding the location.

Parameters

Builder $query

Return Value

void

at line 196
AbstractLocation|null getById(mixed $identifier)

Retrieve a location by their unique identifier.

Parameters

mixed $identifier

Return Value

AbstractLocation|null

at line 211
LocationInterface|null getBySlug(string $slug)

Retrieve a location by their unique slug.

Parameters

string $slug

Return Value

LocationInterface|null

at line 220
searchByCoordinates(CoordinatesInterface $coordinates, $limit = 20)

No description

Parameters

CoordinatesInterface $coordinates
$limit

at line 236
WorkingSchedule workingSchedule($type, null $days = null)

No description

Parameters

$type
null $days

Return Value

WorkingSchedule

at line 262
mixed getSession(string $key = null, string $default = null)

Retrieves key/value pair from session data.

Parameters

string $key

Unique key for the data store.

string $default

A default value to use when value is not found.

Return Value

mixed

at line 269
putSession($key, $value)

No description

Parameters

$key
$value

at line 277
forgetSession($key = null)

No description

Parameters

$key