You are here

public function DeveloperEmailUnique::__construct in Apigee Edge 8

File

src/Plugin/Validation/Constraint/DeveloperEmailUnique.php, line 47

Class

DeveloperEmailUnique
Checks if an email address already belongs to a developer on Apigee Edge.

Namespace

Drupal\apigee_edge\Plugin\Validation\Constraint

Code

public function __construct($options = NULL) {
  parent::__construct($options);
  $config = \Drupal::config('apigee_edge.developer_settings');
  if ($config
    ->get('verification_action') == DeveloperSettingsForm::VERIFICATION_ACTION_DISPLAY_ERROR_ONLY) {
    $this->message = $config
      ->get('display_only_error_message_content.value');
  }
  elseif ($config
    ->get('verification_action') == DeveloperSettingsForm::VERIFICATION_ACTION_VERIFY_EMAIL) {
    $this->message = $config
      ->get('verify_email_error_message.value');
  }
}