Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
ISAICP-5476: Install the 'published_at' field storage definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Aug 22, 2019
1 parent b24a0db commit 7f73403
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions web/modules/custom/joinup_core/joinup_core.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\Core\Database\Database;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Site\Settings;
use Drupal\sparql_entity_storage\Entity\SparqlMapping;
use Drupal\user\Entity\User;
Expand Down Expand Up @@ -295,3 +296,26 @@ function joinup_core_update_8109() {
$entity_type = \Drupal::entityTypeManager()->getDefinition('solr_field_type');
\Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type);
}

/**
* Install the 'Published on' field storage definition.
*/
function joinup_core_update_8110() {
\Drupal::entityDefinitionUpdateManager()->installFieldStorageDefinition(
'published_at',
'node',
'publication_date',
BaseFieldDefinition::create('published_at')
->setLabel(t('Published on'))
->setDescription(t('Keep the publication timestamp for each node.'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDisplayOptions('view', ['type' => 'hidden'])
->setDisplayConfigurable('view', TRUE)
->setDisplayOptions('form', [
'type' => 'publication_date_timestamp',
'weight' => 10,
])
->setDisplayConfigurable('form', TRUE)
);
}

0 comments on commit 7f73403

Please sign in to comment.