Re: [symfony-devs] [Symfony2] validation annotations

2010-12-12 Thread Lukas Kahwe Smith
On 12.12.2010, at 15:46, Lukas Kahwe Smith wrote: > Are all of these version equivalent? Are 1) and 2) just syntax sugar? of course the coolest syntax would be: /** * @validation:Validation({ * NotBlank(), * MinLength(limit=2), * MaxLength(limit=100)

[symfony-devs] [Symfony2] validation annotations

2010-12-12 Thread Lukas Kahwe Smith
Hi Bernhard, Just trying to get an understanding of the annotation syntax to use for the validation annotations: 1) See this example file in DoctrineUserBundle: https://github.com/knplabs/DoctrineUserBundle/blob/symfony2Security/Model/User.php /** * @validation:Validation({ *

Re: [symfony-devs] [Symfony2] validation, annotations and inheritance

2010-11-30 Thread Bernhard Schussek
I agree with Jeremy here. I seriously doubt the people designing the JSR didn't think about this problem, but I have too little experience working with constraints to find a good solution here. I will do some research on how people in the Java world solve this, but using validation groups sounds li

Re: [symfony-devs] [Symfony2] validation, annotations and inheritance

2010-11-30 Thread Jeremy Mikola
I missed the IRC conversation, but I think that validation groups are the answer here. I'm not entirely familiar with JSR-303, but from the limited Java constraint syntax I've worked with (e.g. "@NotNull") they are first-class citizens in the code and seem to stack constraints as classes are exten

Re: [symfony-devs] [Symfony2] validation, annotations and inheritance

2010-11-30 Thread Lukas Kahwe Smith
On 30.11.2010, at 10:15, Lukas Kahwe Smith wrote: > Hi, > > I just realized that there is no way to get rid of validation rules defined > in a parent class when extending. Now I can think of a couple of approaches > to handle this: 4) On IRC Thomas suggested that validation groups could pote

[symfony-devs] [Symfony2] validation, annotations and inheritance

2010-11-30 Thread Lukas Kahwe Smith
Hi, I just realized that there is no way to get rid of validation rules defined in a parent class when extending. Now I can think of a couple of approaches to handle this: 1) all annotations are inherited by default. redefining a property in a child class, clears all parent annotations for tha

Re: [symfony-devs] [Symfony2] Validation annotations

2010-10-07 Thread Fabien Potencier
On 10/7/10 5:26 PM, Bernhard Schussek wrote: Should we then maybe rename the Validation constraint to Set? (or something the like) Then it would more logically explain its usage. /** * @validation:NotNull * @validation:Set({ * @validation:DateTime, * @validation:Dat

Re: [symfony-devs] [Symfony2] Validation annotations

2010-10-07 Thread Pablo Godel
Thanks Jordi, good to know that this is coming. Pablo On Thu, Oct 7, 2010 at 11:58 AM, Jordi Boggiano wrote: > On 07.10.2010 17:56, Pablo Godel wrote: > > Will this also affect the ODM annotations ? > > Yup, it's already been committed: > > > http://github.com/fabpot/symfony/commit/8fbf19694f2

Re: [symfony-devs] [Symfony2] Validation annotations

2010-10-07 Thread Jordi Boggiano
On 07.10.2010 17:56, Pablo Godel wrote: > Will this also affect the ODM annotations ? Yup, it's already been committed: http://github.com/fabpot/symfony/commit/8fbf19694f253e8bacdd677362ee58967506bbb3 Cheers -- Jordi Boggiano @seldaek :: http://seld.be/ -- If you want to report a vulnerabili

Re: [symfony-devs] [Symfony2] Validation annotations

2010-10-07 Thread Pablo Godel
Jon, Will this also affect the ODM annotations ? Pablo On Sat, Oct 2, 2010 at 9:34 AM, Fabien Potencier < fabien.potenc...@symfony-project.com> wrote: > Hi all, > > I have just changed the way we use annotations for validation. > > To avoid naming collision, we have decided to use aliases for a

Re: [symfony-devs] [Symfony2] Validation annotations

2010-10-07 Thread Jordi Boggiano
On 07.10.2010 17:26, Bernhard Schussek wrote: > Should we then maybe rename the Validation constraint to Set? (or > something the like) > > Then it would more logically explain its usage. > >/** > * @validation:NotNull > * @validation:Set({ > * @validation:DateTime, > * @v

Re: [symfony-devs] [Symfony2] Validation annotations

2010-10-07 Thread Bernhard Schussek
Should we then maybe rename the Validation constraint to Set? (or something the like) Then it would more logically explain its usage. /** * @validation:NotNull * @validation:Set({ * @validation:DateTime, * @validation:DateTime * }) */ Cheers, Bernhard -- If you w

[symfony-devs] [Symfony2] Validation annotations

2010-10-02 Thread Fabien Potencier
Hi all, I have just changed the way we use annotations for validation. To avoid naming collision, we have decided to use aliases for all annotations used in Symfony2. So, as of today, instead of using this: /** * @Validation({...@datetime()}) */ You need to use this: /**