I have an entity Category that has Category children like a tree. I have a CategorySelectorType that has a few non-mapped fields which determine what Category should be set to the form data.
I want to be able to include that CategorySelectorType in any entity and update the mapped property in the entity on which the CategorySelectorType is being used.
Imagine
ArticleType.php
$builder->add('title') ;
$builder->add('category','category_selectory') ;
So when binding, the category property should be updated with whatever Categpru was chosen using the CategorySelectorType.
I tried doing it in an event lister durint POST_BIND but I get
Warning: ReflectionProperty::getValue() expects parameter 1 to be object, null given in /home/neron/sites/zabulu/trunk/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 697
And it seems to be caused by
UniqueEntityValidator ->validate (object(Category), object(UniqueEntity))