English 中文(简体)
A. 理论绘图 2
原标题:Mapping with doctrine 2

我在“我”数据库中有这样的问题:

CREATE TABLE IF NOT EXISTS `t_question` (
  `id_question` int(10) NOT NULL AUTO_INCREMENT,
  `heading_key` varchar(255) NOT NULL,
  PRIMARY KEY (`id_question`)
) ENGINE=InnoDB;

因为我想我的问题是多语言的,所以我将其钥匙与另一个表格(t_lang_data)联系起来,该表格为几个用途(问题、文章等等)储存地块。

我的t_lang_data有线结构:

CREATE TABLE IF NOT EXISTS `t_lang_data` (
  `id_lang_data` int(10) NOT NULL AUTO_INCREMENT,
  `key` varchar(255) NOT NULL,
  `lang_iso` int(10) NOT NULL,
  `text` varchar(255) NOT NULL,
  PRIMARY KEY (`id_lang_data`)
) ENGINE=InnoDB;

例如,我可以提出这个问题:

id_question = 1 ; heading_key = heading_quest_1

并且这些土地——数据条目:

id_lang_data = 1 ; key = heading_quest_1 ; lang_iso = en_UK ; text = "Heading for question 1" id_lang_data = 2 ; key = heading_quest_1 ; lang_iso = fr ; text = "Titre de la question 1"

I need to map these relations for Doctrine 2 but I do not know what to do. I have tried a many-to-one and a one-to-many approch but it does not work.

Do someone has an idea please ? Thanks

www.un.org/Depts/DGACM/index_russian.htm 我认识到,这比我想象的更加困难。 事实上,我的“土地——数据表”可以储存许多表格的插图,例如拖,、 t等。 但是,在绘制地图时,似乎我们只能共同绘制两个表格。

因此,我怎么做?

最佳回答
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签