function EntityBundle::buildConfigurationForm
Overrides ConditionPluginBase::buildConfigurationForm
File
-
src/
Plugin/ Condition/ EntityBundle.php, line 80
Class
- EntityBundle
- Provides a 'Entity Bundle' condition.
Namespace
Drupal\ctools\Plugin\ConditionCode
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$options = [];
$bundles = $this->entityTypeBundleInfo
->getBundleInfo($this->bundleOf
->id());
foreach ($bundles as $id => $info) {
$options[$id] = $info['label'];
}
$form['bundles'] = [
'#title' => $this->pluginDefinition['label'],
'#type' => 'checkboxes',
'#options' => $options,
'#default_value' => $this->configuration['bundles'],
];
return parent::buildConfigurationForm($form, $form_state);
}