Add validators for attributes
Validating data with specify rules of attribute , throw error messages when validating failed.
Inspired by: http://laravel.com/docs/validation#rule-in
protected static $attrs = array(
'age' => array('type'=>'integer','rules'=>'required|min:5|max:100'),
'gender' => array('type'=>'string','rules'=>'in:male,female')
);
Hmm interesting concept. Is there a way we can include a 3rd party library of validators to use? I don't know of any off hand but I will look.
@jrschumacher what about this one https://github.com/symfony/Validator?
@wildsurfer yea that looks good @purekid thoughts?
That looks good,let's find a way to extend it.
BTW, just arrived and this is the best PHP Mongo Library I've found...
Just one question (out of docs): @purekid how is validation currently working? I'm looking for save and find data casting to make the usage more error prone.