ZF2 Rest Service/Doctrine Validation
===

I'm struggling with the best way to validate Doctrine 2 entities in a ZF2 Rest Service. I initially implemented validation by extending Zend\InputFilter\InputFilter and attached validators to the filter within the extended class. I'm not sure that this is the best approach, as my validation is entirely separated from my entity classes.

I thought about implementing my validation with annotations as described in Matthew's article http://mwop.net/blog/2012-07-02-zf2-beta5-forms.html, however when instantiating an entity I often have arguments in the constructor, which would not work well with this approach in my opinion.

In addition, my entities often have different validation rules depending on the status of the entity. For example, if I have a BlogPost entity, and it is in "Draft" status, I may require only a subset of the fields. If it is in "Published" status, I then may want to require all of the fields.

Any ideas on the best approach to take here? As this is a REST implementation, I do not need any visuals provided by Zend\Form. Should I continue my approach of extending \Zend\InputFilter\InputFilter? Or should I go in the annotation direction?