class AvailableCountriesEvent in Address 8
Defines the available countries event.
Hierarchy
- class \Drupal\address\Event\AvailableCountriesEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of AvailableCountriesEvent
See also
\Drupal\address\Event\AddressEvents
\Drupal\address\Plugin\Field\FieldType\AddressItem::getAvailableCountries
2 files declare their use of AvailableCountriesEvent
- AddressTestEventSubscriber.php in tests/
modules/ address_test/ src/ EventSubscriber/ AddressTestEventSubscriber.php - AvailableCountriesTrait.php in src/
Plugin/ Field/ FieldType/ AvailableCountriesTrait.php
File
- src/
Event/ AvailableCountriesEvent.php, line 14
Namespace
Drupal\address\EventView source
class AvailableCountriesEvent extends Event {
/**
* The available countries.
*
* A list of country codes.
*
* @var array
*/
protected $availableCountries;
/**
* The field definition.
*
* @var \Drupal\Core\Field\FieldDefinitionInterface
*/
protected $fieldDefinition;
/**
* Constructs a new AvailableCountriesEvent object.
*
* @param array $available_countries
* The available countries.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
*/
public function __construct(array $available_countries, FieldDefinitionInterface $field_definition) {
$this->availableCountries = $available_countries;
$this->fieldDefinition = $field_definition;
}
/**
* Gets the available countries.
*
* @return array
* The available countries.
*/
public function getAvailableCountries() {
return $this->availableCountries;
}
/**
* Sets the available countries.
*
* @param array $available_countries
* The available countries to set.
*
* @return $this
*/
public function setAvailableCountries(array $available_countries) {
$this->availableCountries = $available_countries;
return $this;
}
/**
* Gets the field definition.
*
* @return \Drupal\Core\Field\FieldDefinitionInterface
* The field definition.
*/
public function getFieldDefinition() {
return $this->fieldDefinition;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AvailableCountriesEvent:: |
protected | property | The available countries. | |
AvailableCountriesEvent:: |
protected | property | The field definition. | |
AvailableCountriesEvent:: |
public | function | Gets the available countries. | |
AvailableCountriesEvent:: |
public | function | Gets the field definition. | |
AvailableCountriesEvent:: |
public | function | Sets the available countries. | |
AvailableCountriesEvent:: |
public | function | Constructs a new AvailableCountriesEvent object. |