You are here

public function BrandNotSetException::__construct in Bynder 8.3

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

Constructs BrandNotSetException.

Parameters

string $entity_browser_id: Entity browser ID.

Overrides BynderException::__construct

File

src/Exception/BrandNotSetException.php, line 18

Class

BrandNotSetException
Exception indicating that the brand is not configured on upload widget.

Namespace

Drupal\bynder\Exception

Code

public function __construct($entity_browser_id) {
  $log_message = 'Brand to upload to is not set. Check the <a target="_blank" href=":url">configuration of the widget</a>.';
  $log_message_args = [
    ':url' => Url::fromRoute('entity.entity_browser.edit_form', [
      'entity_browser' => $entity_browser_id,
      'step' => 'widgets',
    ])
      ->toString(),
  ];
  $admin_message = $this
    ->t($log_message, $log_message_args);
  $message = $this
    ->t('Brand to upload to is not set. Please contact the site administrator.');
  parent::__construct($message, $admin_message, $log_message, $log_message_args);
}