class ReadOnlyFormEvent in Configuration Read-only mode 8
Readonly form event.
Hierarchy
- class \Drupal\config_readonly\ReadOnlyFormEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of ReadOnlyFormEvent
2 files declare their use of ReadOnlyFormEvent
- config_readonly.module in ./
config_readonly.module - Contains config_readonly.module.
- ReadOnlyFormSubscriber.php in src/
EventSubscriber/ ReadOnlyFormSubscriber.php
File
- src/
ReadOnlyFormEvent.php, line 11
Namespace
Drupal\config_readonlyView source
class ReadOnlyFormEvent extends Event {
const NAME = 'config_readonly_form_event';
/**
* The form state.
*
* @var \Drupal\Core\Form\FormStateInterface
*/
protected $formState;
/**
* Flag as to whether the form is read only.
*
* @var bool
*/
protected $readOnlyForm;
/**
* Constructs a new ReadOnlyFormEvent object.
*
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
*/
public function __construct(FormStateInterface $form_state) {
$this->readOnlyForm = FALSE;
$this->formState = $form_state;
}
/**
* Get the form state.
*
* @return \Drupal\Core\Form\FormStateInterface
* The form state.
*/
public function getFormState() {
return $this->formState;
}
/**
* Mark the form as read-only.
*/
public function markFormReadOnly() {
$this->readOnlyForm = TRUE;
}
/**
* Check whether the form is read-only.
*
* @return bool
* Whether the form is read-only.
*/
public function isFormReadOnly() {
return $this->readOnlyForm;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ReadOnlyFormEvent:: |
protected | property | The form state. | |
ReadOnlyFormEvent:: |
protected | property | Flag as to whether the form is read only. | |
ReadOnlyFormEvent:: |
public | function | Get the form state. | |
ReadOnlyFormEvent:: |
public | function | Check whether the form is read-only. | |
ReadOnlyFormEvent:: |
public | function | Mark the form as read-only. | |
ReadOnlyFormEvent:: |
constant | |||
ReadOnlyFormEvent:: |
public | function | Constructs a new ReadOnlyFormEvent object. |