Isbn

New in version 2.3: The Isbn constraint was introduced in Symfony 2.3.

Caution

The isbn10 and isbn13 options are deprecated since Symfony 2.5
and will be removed in Symfony 3.0. Use the type option instead.
Furthermore, when using the type option, lowercase characters are no
longer supported starting in Symfony 2.5, as they are not allowed in ISBNs.

// src/Acme/BookcaseBundle/Entity/Book.phpnamespaceAcme\BookcaseBundle\Entity;useSymfony\Component\Validator\Mapping\ClassMetadata;useSymfony\Component\Validator\ConstraintsasAssert;classBook{protected$isbn;publicstaticfunctionloadValidatorMetadata(ClassMetadata$metadata){$metadata->addPropertyConstraint('isbn',newAssert\Isbn(array('type'=>isbn10,'message'=>'This value is not valid.')));}}