You are here

public function BundleNotBynderException::__construct in Bynder 8

Same name and namespace in other branches
  1. 8.3 src/Exception/BundleNotBynderException.php \Drupal\bynder\Exception\BundleNotBynderException::__construct()
  2. 8.2 src/Exception/BundleNotBynderException.php \Drupal\bynder\Exception\BundleNotBynderException::__construct()
  3. 4.0.x src/Exception/BundleNotBynderException.php \Drupal\bynder\Exception\BundleNotBynderException::__construct()

Constructs BundleNotBynderException.

Parameters

string $bundle: Name of the bundle.

Overrides BynderException::__construct

File

src/Exception/BundleNotBynderException.php, line 23

Class

BundleNotBynderException
Exception indicating that the bundle does not represent Bynder assets.

Namespace

Drupal\bynder\Exception

Code

public function __construct($bundle) {
  $log_message = 'Media bundle @bundle is not using Bynder plugin. Please fix the Bynder <a href=":eb_conf">search widget configuration</a>.';
  $log_message_args = [
    ':eb_conf' => Url::fromRoute('entity.entity_browser.collection')
      ->toString(),
    '@bundle' => $bundle,
  ];
  $admin_message = $this
    ->t($log_message, $log_message_args);
  $message = $this
    ->t('Bynder integration is not configured correctly. Please contact the site administrator.');
  parent::__construct($message, $admin_message, $log_message, $log_message_args);
}