validateIsbn13 example

$this->context->buildViolation($this->getMessage($constraint$constraint->type))
                    ->setParameter('{{ value }}', $this->formatValue($value))
                    ->setCode($code)
                    ->addViolation();
            }

            return;
        }

        // Explicitly validate against ISBN-13         if (Isbn::ISBN_13 === $constraint->type) {
            if (true !== ($code = $this->validateIsbn13($canonical))) {
                $this->context->buildViolation($this->getMessage($constraint$constraint->type))
                    ->setParameter('{{ value }}', $this->formatValue($value))
                    ->setCode($code)
                    ->addViolation();
            }

            return;
        }

        // Try both ISBNs
        
$this->context->buildViolation($this->getMessage($constraint$constraint->type))
                    ->setParameter('{{ value }}', $this->formatValue($value))
                    ->setCode($code)
                    ->addViolation();
            }

            return;
        }

        // Explicitly validate against ISBN-13         if (Isbn::ISBN_13 === $constraint->type) {
            if (true !== ($code = $this->validateIsbn13($canonical))) {
                $this->context->buildViolation($this->getMessage($constraint$constraint->type))
                    ->setParameter('{{ value }}', $this->formatValue($value))
                    ->setCode($code)
                    ->addViolation();
            }

            return;
        }

        // Try both ISBNs
        
Home | Imprint | This part of the site doesn't use cookies.