[FLOW3-general] How validators are resolved
Adrian Grigore
adrian at fjoor.com
Wed Mar 31 22:53:54 CEST 2010
Ok sent this from another email address, if that got through sorry for the
repost.
I posted this question on IRC but got no answer so I'm posting again here.
Shouldn't the ValidatorResolver recurse through all the properties of an
object to create the validators. For instance, let's say I have the
following models:
<?php
class Person {
/**
* @var \PersonName
*/
protected $name;
}
class PersonName {
/**
* @var string
* @validate StringLength(minimum = 2, maximum = 30)
*/
protected $firstName;
/**
* @var string
* @validate StringLength(minimum = 2, maximum = 30)
*/
protected $lastName;
}
Shouldn't the ValidatorResolver also create validators for the $name
property, using the validation information in the PersonName class
declaration?
--
Thanks,
Adrian
--
Thanks,
Adrian
More information about the FLOW3-general
mailing list