| @@ -1,15 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace IvyForms\ValueObjects\Entry; |
| 4 | 4 | |
| 5 | -// phpcs:disable PSR1.Files.SideEffects | |
| 6 | 5 | use IvyForms\Common\Exceptions\ValidationException; |
| 6 | +use IvyForms\Services\Translations\BackendStrings; | |
| 7 | 7 | |
| 8 | -if (!defined('ABSPATH')) { | |
| 9 | - exit; // Exit if accessed directly | |
| 10 | -} | |
| 11 | - | |
| 12 | 8 | /** |
| 13 | 9 | * Class EntryField |
| 14 | 10 | * |
| 15 | 11 | * Represents a single field value in a form entry. |
| @@ -104,9 +100,9 @@ | ||
| 104 | 100 | */ |
| 105 | 101 | private function validateId(int $id): int |
| 106 | 102 | { |
| 107 | 103 | if ($id < 0) { |
| 108 | - throw new ValidationException("Id must be a positive integer."); | |
| 104 | + throw new ValidationException(BackendStrings::getExceptionStrings()['id_positive_integer']); | |
| 109 | 105 | } |
| 110 | 106 | return $id; |
| 111 | 107 | } |
| 112 | 108 | |