symfony/symfony — Issue #2943: [Form] Error with Proxies class as value
Author: Gregwar
Created: 2011-12-22 14:46:20+00:00
State: open

When I'm rendering a form with an `entity` field which is a proxy class (for instance, the user's category), the identifier is not correctly retreived, that's because the Doctrine's proxy implementation changed and now the `getId()` looks like this :

```php
__isInitialized__ === false) {
return (int) $this->_identifier["id"];
}
$this->__load();
return parent::getId();
}
```

And the identifier is retreived this way :
```php
// Doctrine/ORM/Mapping/ClassMetaData.php L170
$value = $this->reflFields[$this->identifier[0]]->getValue($entity);
```

It results that the value is not filled (the correct line is not selected in the `` for instance)