drupal-8.instagram-block-2778667.add-block.php in Instagram Block 8.2
Same filename and directory in other branches
Contains database additions to add block to Drupal.
File
tests/fixtures/update/drupal-8.instagram-block-2778667.add-block.phpView source
<?php
/**
* @file
* Contains database additions to add block to Drupal.
*/
use Drupal\Component\Serialization\Yaml;
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Load the Instagram block from config.
$block_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/block.block.testaccesstokenmove.yml'));
foreach ($block_configs as $block_config) {
$connection
->insert('config')
->fields([
'collection',
'name',
'data',
])
->values([
'collection' => '',
'name' => 'block.block.' . $block_config['id'],
'data' => serialize($block_config),
])
->execute();
}