This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Delete unwanted blocks programmatically. | |
| * | |
| * @param array $blocks | |
| * Array of block UUIDs for deletion. | |
| */ | |
| function _delete_blocks(array $blocks) { | |
| foreach($blocks as $uuid) { | |
| $block_content = \Drupal::service('entity.repository')->loadEntityByUuid('block_content', $uuid); | |
| if (!is_null($block_content)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Import configs that may be needed for any further updates. | |
| * These files should be placed in config/install/[update_id] in this module for initial | |
| * installation. The configs should also be placed in /config/default for all future | |
| * modifications. | |
| * | |
| * Based on https://stackoverflow.com/a/52277490/1650120. | |
| * | |
| * @param string $update_id | |
| * The name of the folder in containing the yml files. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Creates install content. | |
| * | |
| * @param array $content | |
| * Content keyed by entity-type and UUID. | |
| * | |
| * @return array | |
| * An array of entities created, keyed like the parameter. | |
| */ | |
| function _create_content(array $content) { |