php - symfony2 model with custom primary key name (different than "id") -


can paste example definition of symfony2/doctrine model has primary key different id (the name, e.g. primary key customer_id)?

i've been searching web , i've scanned entire cheatsheet (http://ormcheatsheet.com/) couldn't find one.

for example, having following schema:

author:   type: entity   fields:     id:       id: true       type: integer       generator:         strategy: auto 

what should change replace id author_id preserving remains primary key?

something this?

author:   type: entity   id:     author_id:       type: integer       generator:         strategy: auto   fields:     name:       type: string       length: 50 

reference


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -