class ConfigEntityRevisionFields in Config Entity Revisions 8
Same name and namespace in other branches
- 8.2 src/ConfigEntityRevisionFields.php \Drupal\config_entity_revisions\ConfigEntityRevisionFields
- 1.x src/ConfigEntityRevisionFields.php \Drupal\config_entity_revisions\ConfigEntityRevisionFields
Hierarchy
- class \Drupal\config_entity_revisions\ConfigEntityRevisionFields implements ConfigEntityRevisionFieldsInterface
Expanded class hierarchy of ConfigEntityRevisionFields
2 files declare their use of ConfigEntityRevisionFields
- ViewsRevisionFields.php in modules/
views_revisions/ src/ ViewsRevisionFields.php - WebformRevisionFields.php in modules/
webform_revisions/ src/ WebformRevisionFields.php
File
- src/
ConfigEntityRevisionFields.php, line 5
Namespace
Drupal\config_entity_revisionsView source
class ConfigEntityRevisionFields implements ConfigEntityRevisionFieldsInterface {
/**
* Should new revisions created by default?
*
* @return bool
* No new revision by default.
*/
public static function getNewRevisionDefault() {
return FALSE;
}
/**
* Adds the revision form fields to the form.
*
* @param &$form
* The form to which the fields should be added.
*/
public static function addRevisionFormFields(&$form) {
// Add a log field if the "Create new revision" option is checked, or if the
// current user has the ability to check that option.
$new_revision_default = self::getNewRevisionDefault();
$form['revision'] = [
'#type' => 'checkbox',
'#title' => t('Create new revision'),
'#default_value' => $new_revision_default,
'#group' => 'revision_information',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigEntityRevisionFields:: |
public static | function |
Adds the revision form fields to the form. Overrides ConfigEntityRevisionFieldsInterface:: |
|
ConfigEntityRevisionFields:: |
public static | function |
Should new revisions created by default? Overrides ConfigEntityRevisionFieldsInterface:: |