You are here

public function DeveloperToUserConversionUserNameAlreadyTakenException::__construct in Apigee Edge 8

DeveloperToUserConversionUserNameAlreadyTakenException constructor.

Parameters

\Drupal\apigee_edge\Entity\DeveloperInterface $developer: Developer entity.

\Symfony\Component\Validator\ConstraintViolationInterface $violation: Constraint violation.

string $message: Exception message.

int $code: Error code.

\Throwable|null $previous: Previous exception.

Overrides DeveloperToUserConversationInvalidValueException::__construct

File

src/Exception/DeveloperToUserConversionUserNameAlreadyTakenException.php, line 45

Class

DeveloperToUserConversionUserNameAlreadyTakenException
Throw when developer's username is already taken in Drupal.

Namespace

Drupal\apigee_edge\Exception

Code

public function __construct(DeveloperInterface $developer, ConstraintViolationInterface $violation, string $message = 'The username "@username" is already taken in Drupal.', int $code = 0, ?\Throwable $previous = NULL) {
  $message = strtr($message, [
    '@username' => $developer
      ->getUserName(),
  ]);
  parent::__construct('username', 'name', $violation, $developer, $message, $code, $previous);
}