Commit f0e43a66 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 7ecc82fd
......@@ -35,10 +35,12 @@ $conn->export->exportClasses(array('NewsItem'));
The following code example executes two sql statements. When using mysql those statements would look like:
<code>
CREATE TABLE news_item (id INT NOT NULL AUTO_INCREMENT, title VARCHAR(200), content TEXT)
CREATE TABLE news_item (id INT NOT NULL AUTO_INCREMENT, content TEXT)
CREATE TABLE news_item_translation (id INT NOT NULL, title VARCHAR(200), lang VARCHAR(20))
</code>
Notice how the field 'title' is not present in the news_item table. Since its present in the translation table it would be a waste of resources to have that same field in the main table. Basically Doctrine always automatically removes all translated fields from the main table.
+++ Using I18n
In the following example we add some data with finnish and english translations:
......@@ -49,7 +51,6 @@ $item->title = 'Some title';
$item->content = 'This is some content. This field is not being translated.';
$item->Translation['FI']->title = 'Joku otsikko';
$item->Translation['FI']->lang = 'FI';
$item->save();
</code>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment