cedriclombardot/AdmingeneratorGeneratorBundle — Issue #68: Primary Key named other than "id"
Author: daum
Created: 2011-12-09 20:57:41+00:00
State: open

Wanted to open a discussion about how we want to do this. Right now a bunch of the templates have a hard coded "id" on most of the actions. For doctrine we can get the PK of the object via the following with the entity manager ($em)

```php
$em->getMetadataFactory()->getMetaDataFor('MyBundle:MyEntity')->getSingleIdentifierFieldName()
```

So we could do that to get the column in doctrine. I'm not a propel user so not sure on that one.

For the templates where right now it is:
```
"{ 'id': " ~ builder.ModelClass ~ ".id }"
```

We could do something like builder.ModelPrimaryKey instead of hard coding the id. What do you think?