function create_storage_published in Modal 8.2
Same name and namespace in other branches
- 8.3 modal_page.install \create_storage_published()
- 5.0.x modal_page.install \create_storage_published()
- 4.0.x modal_page.install \create_storage_published()
- 4.1.x modal_page.install \create_storage_published()
Create the field published.
1 call to create_storage_published()
- modal_page_update_8202 in ./
modal_page.install - Implements hook_update_N().
File
- ./
modal_page.install, line 174 - Install, update and uninstall functions for the Modal Page.
Code
function create_storage_published() {
$field_storage_definition = BaseFieldDefinition::create('boolean')
->setLabel(t("Published"))
->setDefaultValue(TRUE)
->setDisplayConfigurable('form', TRUE)
->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
'settings' => [
'display_label' => TRUE,
],
'weight' => -5,
]);
\Drupal::entityDefinitionUpdateManager()
->installFieldStorageDefinition('published', 'modal_page_modal', 'modal_page_modal', $field_storage_definition);
}