entity_legal.post_update.php in Entity Legal 8.2
Same filename and directory in other branches
Post-update scripts for Entity Legal module.
File
entity_legal.post_update.phpView source
<?php
/**
* @file
* Post-update scripts for Entity Legal module.
*/
use Drupal\Core\Config\Entity\ConfigEntityUpdater;
use Drupal\entity_legal\EntityLegalDocumentInterface;
/**
* Allow customizing the legal document title.
*/
function entity_legal_post_update_title_pattern(array &$sandbox) {
\Drupal::classResolver(ConfigEntityUpdater::class)
->update($sandbox, ENTITY_LEGAL_DOCUMENT_ENTITY_NAME, function (EntityLegalDocumentInterface $document) {
$settings = $document
->get('settings');
$settings['title_pattern'] = '[entity_legal_document:published-version:label]';
$document
->set('settings', $settings);
return TRUE;
});
}
Functions
Name | Description |
---|---|
entity_legal_post_update_title_pattern | Allow customizing the legal document title. |