class InitialValuesEvent in Address 8
Defines the initial values event.
Hierarchy
- class \Drupal\address\Event\InitialValuesEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of InitialValuesEvent
Deprecated
in address:8.x-1.5 and is removed from address:8.x-2.0. Use hook_field_widget_form_alter() to change the address #default_value.
See also
https://www.drupal.org/project/address/issues/2838457
File
- src/
Event/ InitialValuesEvent.php, line 16
Namespace
Drupal\address\EventView source
class InitialValuesEvent extends Event {
/**
* The initial values.
*
* @var array
*/
protected $initialValues;
/**
* The field definition.
*
* @var \Drupal\Core\Field\FieldDefinitionInterface
*/
protected $fieldDefinition;
/**
* Constructs a new InitialValuesEvent object.
*
* @param array $initial_values
* The initial values.
* @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
* The field definition.
*/
public function __construct(array $initial_values, FieldDefinitionInterface $field_definition) {
$this->initialValues = $initial_values;
$this->fieldDefinition = $field_definition;
}
/**
* Gets the initial values.
*
* @return array
* The initial values.
*/
public function getInitialValues() {
return $this->initialValues;
}
/**
* Sets the initial values.
*
* @param array $initial_values
* The initial values to set.
*
* @return $this
*/
public function setInitialValues(array $initial_values) {
$this->initialValues = $initial_values;
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 |
---|---|---|---|---|
InitialValuesEvent:: |
protected | property | The field definition. | |
InitialValuesEvent:: |
protected | property | The initial values. | |
InitialValuesEvent:: |
public | function | Gets the field definition. | |
InitialValuesEvent:: |
public | function | Gets the initial values. | |
InitialValuesEvent:: |
public | function | Sets the initial values. | |
InitialValuesEvent:: |
public | function | Constructs a new InitialValuesEvent object. |