You are here

public function DeveloperToUserConversationInvalidValueException::__construct in Apigee Edge 8

DeveloperToUserConversationInvalidValueException constructor.

Parameters

string $attribute_name: The source property on the developer.

string $target: Name of the destination field on the user.

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

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

string $message: Exception message.

int $code: Error code.

\Throwable|null $previous: Previous exception.

Overrides DeveloperToUserConversionException::__construct

1 call to DeveloperToUserConversationInvalidValueException::__construct()
DeveloperToUserConversionUserNameAlreadyTakenException::__construct in src/Exception/DeveloperToUserConversionUserNameAlreadyTakenException.php
DeveloperToUserConversionUserNameAlreadyTakenException constructor.
1 method overrides DeveloperToUserConversationInvalidValueException::__construct()
DeveloperToUserConversionUserNameAlreadyTakenException::__construct in src/Exception/DeveloperToUserConversionUserNameAlreadyTakenException.php
DeveloperToUserConversionUserNameAlreadyTakenException constructor.

File

src/Exception/DeveloperToUserConversationInvalidValueException.php, line 71

Class

DeveloperToUserConversationInvalidValueException
Thrown when a developer attribute's value is not a valid user field value.

Namespace

Drupal\apigee_edge\Exception

Code

public function __construct(string $attribute_name, string $target, ConstraintViolationInterface $violation, DeveloperInterface $developer, string $message = 'Unable to set "@value" value from "@source" source on "@target" target. @reason', int $code = 0, ?\Throwable $previous = NULL) {
  $this->source = $attribute_name;
  $this->target = $target;
  $this->violation = $violation;
  $message = strtr($message, [
    '@reason' => $violation
      ->getMessage(),
    '@source' => $attribute_name,
    '@target' => $target,
    '@value' => is_object($violation
      ->getInvalidValue()) ? $violation
      ->getInvalidValue() instanceof ItemList ? var_export($violation
      ->getInvalidValue()
      ->getValue(), TRUE) : $violation
      ->getInvalidValue()->value : $violation
      ->getInvalidValue(),
  ]);
  parent::__construct($developer, $message, $code, $previous);
}