I am beginning to work with Symfony, I've found some documentation about inheritance. But also found this discouraging article, which make me doubt if Doctrine handles inheritance any good at all...
Has anyone find a smart solution for inheritance in Symfony+Doctrine?
As an example, I have already structured the database something like this:
CREATE TABLE `poster` (
`poster_id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(50) NOT NULL,
PRIMARY KEY (`poster_id`),
UNIQUE KEY `id` (`poster_id`),
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`real_name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `user_id` (`user_id`),
CONSTRAINT `user_fk` FOREIGN KEY (`user_id`) REFERENCES `poster` (`poster_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
From that, Doctrine generated this "schema.yml":
Poster:
connection: doctrine
tableName: poster
columns:
poster_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
user_name:
type: string(50)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Post:
local: poster_id
foreign: poster_id
type: many
User:
local: poster_id
foreign: user_id
type: many
Version:
local: poster_id
foreign: poster_id
type: many
User:
connection: doctrine
tableName: user
columns:
user_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: false
real_name:
type: string(50)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Poster:
local: user_id
foreign: poster_id
type: one
User creation for this structure with Doctrine auto-generated forms does not work.
Any clue will be appreciated.