- Entity FieldTypes (identifier, name)
- Entity Fields (ID, Name, FieldType)
- Entity FieldValues (ID, CollectionID, field, value)
- Content object (identifier, fields, data)
- Entity i18n (, , , )
:
insert into FieldTypes('S', 'string');
insert into FieldTypes('DT', 'date/time');
insert into Fields(1, 'Author', 'S');
insert into Fields(2, 'Created', 'D');
insert into i18n(1, 1, 'en', 'Author');
insert into i18n(2, 1, 'ru', '');
insert into i18n(3, 2, 'en', 'Created');
insert into i18n(4, 2, 'ru', '');
insert into Content(1, 2, 'Test data');
insert into FieldValues(3, 2, 1, 'Tester');
insert into FieldValues(4, 2, 2, '2011-03-20T12:20:00');
select c.ID, f.ID, i.Value as FieldName, fv.Value as FieldValue
from Content c, FieldValues fv, Fields f, i18n i
where c.Fields = fv.CollectionID
and fv.Field = i.Field
and i.LanguageID = :UserLanguage
and c.ID = :ContentID