public function QueueStorageEntityTypeForm::form in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/social_queue_storage/src/Form/QueueStorageEntityTypeForm.php \Drupal\social_queue_storage\Form\QueueStorageEntityTypeForm::form()
- 8.8 modules/custom/social_queue_storage/src/Form/QueueStorageEntityTypeForm.php \Drupal\social_queue_storage\Form\QueueStorageEntityTypeForm::form()
- 10.3.x modules/custom/social_queue_storage/src/Form/QueueStorageEntityTypeForm.php \Drupal\social_queue_storage\Form\QueueStorageEntityTypeForm::form()
- 10.0.x modules/custom/social_queue_storage/src/Form/QueueStorageEntityTypeForm.php \Drupal\social_queue_storage\Form\QueueStorageEntityTypeForm::form()
- 10.2.x modules/custom/social_queue_storage/src/Form/QueueStorageEntityTypeForm.php \Drupal\social_queue_storage\Form\QueueStorageEntityTypeForm::form()
Gets the actual form array to be built.
Overrides EntityForm::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
File
- modules/
custom/ social_queue_storage/ src/ Form/ QueueStorageEntityTypeForm.php, line 16
Class
- QueueStorageEntityTypeForm
- Class QueueStorageEntityTypeForm.
Namespace
Drupal\social_queue_storage\FormCode
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$queue_storage_entity_type = $this->entity;
$form['label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Label'),
'#maxlength' => 255,
'#default_value' => $queue_storage_entity_type
->label(),
'#description' => $this
->t('Label for the Queue storage entity type.'),
'#required' => TRUE,
];
$form['id'] = [
'#type' => 'machine_name',
'#default_value' => $queue_storage_entity_type
->id(),
'#machine_name' => [
'exists' => '\\Drupal\\social_queue_storage\\Entity\\QueueStorageEntityType::load',
],
'#disabled' => !$queue_storage_entity_type
->isNew(),
];
/* You will need additional form elements for your custom properties. */
return $form;
}