class GetLocationEvent in Smart IP 8.2
Same name and namespace in other branches
- 8.4 src/GetLocationEvent.php \Drupal\smart_ip\GetLocationEvent
- 8.3 src/GetLocationEvent.php \Drupal\smart_ip\GetLocationEvent
Provides Smart IP query location override event for event listeners.
@package Drupal\smart_ip
Hierarchy
- class \Drupal\smart_ip\GetLocationEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of GetLocationEvent
1 file declares its use of GetLocationEvent
- SmartIpEventSubscriber.php in modules/
smart_ip_ipinfodb_web_service/ src/ EventSubscriber/ SmartIpEventSubscriber.php - Contains \Drupal\smart_ip_ipinfodb_web_service\EventSubscriber\SmartIpEventSubscriber.
1 string reference to 'GetLocationEvent'
1 service uses GetLocationEvent
File
- src/
GetLocationEvent.php, line 16 - Contains \Drupal\smart_ip\GetLocationEvent.
Namespace
Drupal\smart_ipView source
class GetLocationEvent extends Event {
/**
* Contains user's location
*
* @var \Drupal\smart_ip\SmartIpLocationInterface
*/
protected $location;
/**
* Contains Smart IP data source info
*
* @var string
*/
protected $dataSource;
/**
* Constructs a Smart IP event.
*
* @param \Drupal\smart_ip\SmartIpLocationInterface $location
*/
public function __construct(SmartIpLocationInterface $location) {
$this
->setLocation($location);
$this->dataSource = \Drupal::config('smart_ip.settings')
->get('data_source');
}
/**
* @return \Drupal\smart_ip\SmartIpLocationInterface
*/
public function getLocation() {
return $this->location;
}
/**
* @param \Drupal\smart_ip\SmartIpLocationInterface $location
*/
public function setLocation(SmartIpLocationInterface $location) {
$this->location = $location;
}
/**
* @return string
*/
public function getDataSource() {
return $this->dataSource;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GetLocationEvent:: |
protected | property | Contains Smart IP data source info | |
GetLocationEvent:: |
protected | property | Contains user's location | |
GetLocationEvent:: |
public | function | ||
GetLocationEvent:: |
public | function | ||
GetLocationEvent:: |
public | function | ||
GetLocationEvent:: |
public | function | Constructs a Smart IP event. |