Y
Y
Yuri Petrashevich2015-02-18 15:09:21
Doctrine ORM
Yuri Petrashevich, 2015-02-18 15:09:21

Doctrine2 - how to do uniqueness validation?

The entity itself has a line

* @ORM\Table(name="certificates", uniqueConstraints={@ORM\UniqueConstraint(name="number", columns={"number"})})

those. doctrine knows that the number field has a unique parameter in the database
. How can I make sure that the doctrine checks whether the data is inserted into the database or not before writing the data to the database?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question