You are here

private function BlazyAdminFormatterBase::getBundles in Blazy 7

Returns the expected bundles.

1 call to BlazyAdminFormatterBase::getBundles()
BlazyAdminFormatterBase::getFieldOptions in src/Form/BlazyAdminFormatterBase.php
Returns available fields for select options.

File

src/Form/BlazyAdminFormatterBase.php, line 231

Class

BlazyAdminFormatterBase
A base for field formatter admin to have re-usable methods in one place.

Namespace

Drupal\blazy\Form

Code

private function getBundles($instance, array $bundles = []) {

  // Paragraphs.
  $allowed_bundles = isset($instance['settings']['allowed_bundles']) ? $instance['settings']['allowed_bundles'] : [];

  // File entity.
  if (empty($allowed_bundles)) {
    $allowed_bundles = isset($instance['widget']['settings']['allowed_types']) ? $instance['widget']['settings']['allowed_types'] : [];
  }
  return $allowed_bundles;
}