我尝试使用SonataAdminBundle& amp;来尝试实现此翻译示例(https://gist.github.com/tristanbes/2116290) DoctrineExtensions,但是当我运行create action表单时,数据库转换字段object_id为空。所有其他字段都在数据库中正确填充!
我的数据库架构:
CREATE TABLE `Book` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` longtext,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_6BD70C0F5E237E06` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
CREATE TABLE `book_translations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` int(11) DEFAULT NULL,
`locale` varchar(8) COLLATE utf8_unicode_ci NOT NULL,
`field` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`content` longtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `lookup_unique_idx` (`locale`,`object_id`,`field`),
KEY `IDX_9F5610DF232D562B` (`object_id`),
CONSTRAINT `FK_9F5610DF232D562B` FOREIGN KEY (`object_id`) REFERENCES `Book` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
任何人都可以帮助我吗?我有相同的来源!!!
提前致谢, Luis Miguens