Abhoryo / APYJsFormValidationBundle

This bundle performs validations of a form in javascript. (i18n compatible and several javascript frameworks supported)
92 stars 23 forks source link

[UniqueEntity] multiple-column #12

Open recipe opened 11 years ago

recipe commented 11 years ago

We have to provide support of UniqueEntity validation for the case when multiple-column are set @UniqueEntity(fields={"field1", "field2", "fieldN"}):

<?php
namespace Ns\SomeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * @ORM\Entity(repositoryClass="Ns\SomeBundle\Repository\FooRepository")
 * @ORM\Table(name="foo")
 * @UniqueEntity(fields={"field1", "field2", "fieldN"})
 */
class Foo 
{
    //...
}