Location
class Location extends Manager
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 | from Manager | |
protected | $defaultLocation | from Manager | |
protected | $locationModel | ||
protected | $loaded | from Manager | |
static protected | $schedulesCache | from Manager | |
static protected Closure | $locationSlugResolver | The route parameter resolver callback. |
from Manager |
Methods
Create a new event binding.
Create a new event binding that fires once only
Sort the listeners for a given event by priority.
Fire an event and call the listeners.
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.
No description
No description
Retrieve a location by their unique identifier.
Retrieve a location by their unique slug.
Retrieves key/value pair from session data.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
in
EventEmitter at line 36
EventEmitter
bindEvent(string $event, callable $callback, int $priority = 0)
Create a new event binding.
in
EventEmitter at line 52
EventEmitter
bindEventOnce(string $event, callable $callback)
Create a new event binding that fires once only
in
EventEmitter at line 66
protected void
emitterEventSortEvents(string $eventName)
Sort the listeners for a given event by priority.
in
EventEmitter at line 84
EventEmitter
unbindEvent(string $event = null)
Destroys an event binding.
in
EventEmitter at line 124
string|array
fireEvent(string $event, array $params = [], bool $halt = false)
Fire an event and call the listeners.
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);
in
Manager at line 54
string
resolveLocationSlug()
Resolve the location slug from route parameter.
in
Manager at line 67
void
locationSlugResolver(Closure $resolver)
Set the location route parameter resolver callback.
at line 106
mixed
getDefaultLocation()
No description
in
Manager at line 83
setDefaultLocation(string $defaultLocation)
No description
in
Manager at line 88
getDefault()
No description
at line 18
current()
No description
in
Manager at line 117
setCurrent(LocationInterface $locationModel)
No description
in
Manager at line 126
getModel()
No description
in
Manager at line 135
setModel(LocationInterface $model)
No description
in
Manager at line 142
setModelById($id)
No description
in
Manager at line 149
setModelClass($className)
No description
in
Manager at line 158
AbstractLocation
createLocationModel()
Creates a new instance of the location model
in
Manager at line 169
protected
createLocationModelQuery()
Prepares a query derived from the location model.
in
Manager at line 185
void
extendLocationQuery(Builder $query)
Extend the query used for finding the location.
in
Manager at line 196
AbstractLocation|null
getById(mixed $identifier)
Retrieve a location by their unique identifier.
in
Manager at line 211
LocationInterface|null
getBySlug(string $slug)
Retrieve a location by their unique slug.
in
Manager at line 220
searchByCoordinates(CoordinatesInterface $coordinates, $limit = 20)
No description
in
Manager at line 236
WorkingSchedule
workingSchedule($type, null $days = null)
No description
in
Manager at line 262
mixed
getSession(string $key = null, string $default = null)
Retrieves key/value pair from session data.
in
Manager at line 269
putSession($key, $value)
No description
in
Manager at line 277
forgetSession($key = null)
No description
at line 13
check()
No description
at line 44
clearCurrent()
No description
at line 49
hasAccess($location)
No description
at line 57
hasRestriction()
No description
at line 65
isSingleMode()
No description
at line 70
getId()
No description
at line 75
getName()
No description
at line 80
getAll()
No description
at line 88
getIdOrAll()
No description
at line 93
getLocation()
No description
at line 98
listLocations()
No description
at line 114
hasOneLocation()
No description
at line 122
hasLocations()
No description
at line 133
protected
getLocations()
No description
at line 143
protected User
getAuth()
No description
at line 148
protected
isAttachedToAuth($id)
No description