SmcAddressLatin/src/Core/Checkout/Cart/Error/ShippingAddressLengthError.php

46 lines
1006 B
PHP

<?php declare(strict_types=1);
namespace SmcAddressLatin\Core\Checkout\Cart\Error;
use Shopware\Core\Checkout\Cart\Error\Error;
class ShippingAddressLengthError extends Error
{
private const KEY = 'address-invalid-length';
private string $erroneousFieldName;
private int $maxLength;
public function __construct(string $erroneousFieldName, int $maxLength)
{
$this->erroneousFieldName = $erroneousFieldName;
$this->maxLength = $maxLength;
parent::__construct();
}
public function getId(): string
{
return $this->erroneousFieldName;
}
public function getMessageKey(): string
{
return self::KEY;
}
public function getLevel(): int
{
return self::LEVEL_ERROR;
}
public function blockOrder(): bool
{
return true;
}
public function getParameters(): array
{
return [ 'erroneousFieldName' => $this->erroneousFieldName, 'maxLength' => $this->maxLength ];
}
}