public function AssignmentBaseForm::buildForm in Features 8.4
Same name and namespace in other branches
- 8.3 modules/features_ui/src/Form/AssignmentBaseForm.php \Drupal\features_ui\Form\AssignmentBaseForm::buildForm()
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides FormInterface::buildForm
File
- modules/
features_ui/ src/ Form/ AssignmentBaseForm.php, line 24
Class
- AssignmentBaseForm
- Configures the selected configuration assignment method for this site.
Namespace
Drupal\features_ui\FormCode
public function buildForm(array $form, FormStateInterface $form_state, $bundle_name = NULL) {
$this->currentBundle = $this->assigner
->loadBundle($bundle_name);
$settings = $this->currentBundle
->getAssignmentSettings(self::METHOD_ID);
// Pass the last argument to limit the select to config entity types that
// provide bundles for other entity types.
$this
->setConfigTypeSelect($form, $settings['types']['config'], $this
->t('base'), TRUE);
// Pass the last argument to limit the select to content entity types do
// not have config entity provided bundles, thus avoiding duplication with
// the config type select options.
$this
->setContentTypeSelect($form, $settings['types']['content'], $this
->t('base'), TRUE);
$this
->setActions($form, self::METHOD_ID);
return $form;
}