You are here

protected function ContentEmbedBlock::getDefaultNids in Content Browser 8

Gets the default NIDs for this Block.

Return value

array An array of Node IDs that are currently set in the Block configuration.

2 calls to ContentEmbedBlock::getDefaultNids()
ContentEmbedBlock::blockForm in src/Plugin/Block/ContentEmbedBlock.php
ContentEmbedBlock::build in src/Plugin/Block/ContentEmbedBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/ContentEmbedBlock.php, line 240

Class

ContentEmbedBlock
Provides the "Content Embed" block.

Namespace

Drupal\content_browser\Plugin\Block

Code

protected function getDefaultNids() {

  // We optionally support UUIDs being put directly to our configuration, to
  // support profiles providing Content Embed Blocks with default config.
  if (!empty($this->configuration['uuids'])) {
    $nids = \Drupal::entityQuery('node')
      ->condition('uuid', $this->configuration['uuids'], 'IN')
      ->execute();
  }
  else {
    $nids = [];
  }

  // Merge in the normal configuration.
  $nids += $this->configuration['nids'];
  return $nids;
}