zendframework/zf2 — pull request #5741 by veewee (2014-01-23 12:47:57+00:00)
Title: Make allowObjectBinding configurable for Fieldsets

While working on a module with form annotations, I bumped into a problem:
- I created a ComposedObject annotation with is_collection= false (so a Fieldset).
- Next I added a Hydrator annotation for this fieldset only.
- The fieldset did not get populated with the attached object.

This is because there is no object attached to the fieldset yet while binding a new object.
Therefor, it should be configurable which objects are allowed and which not.

This commit will make it possible to use
```php
/**
* @Form\ComposedObject({"target_object": "Application\Entity\Connection", "is_collection": false, "options": {
* "use_as_base_fieldset": false,
* "allowed_object_binding_class": "Application\Entity\Connection"
* }});
* @Form\Flags({"priority": 960})
* @Form\Hydrator("Application\Hydrator\Connection")
*
* @var \Application\Entity\Connection
*/
protected $connection;
```

When an object is bound to the form, the getConnection() will return a Application\Entity\Connection instance. Therefore the custom hydrator will be used and the form will work as suspected.