Hi,
I have the following scheme that works properly.
In particular, generates the correct field relations
musica_recensioni.creato_da_ana_nomi_id and
musica_recensioni.aggiornato_da_ana_nomi_id
AnaNomi:
tableName: ana_nomi
actAs:
Timestampable:
created:
name: creato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
updated:
name: aggiornato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
Sluggable:
fields: [nome, cognome]
I18n:
fields: [scheda, creato_il, aggiornato_il]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
cognome:
type: string(30)
default: ''
notnull: true
nome: string(30)
scheda: string(2147483647)
scheda_ita: string(2147483647)
data_nascita: date(25)
creato_da_ana_nomi_id: integer(4)
aggiornato_da_ana_nomi_id: integer(4)
MusicaRecensioni:
tableName: musica_recensioni
actAs:
Timestampable:
created:
name: creato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
updated:
name: aggiornato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
I18n:
fields: [testo, pubblicato, creato_il, aggiornato_il]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
no_in_home_page:
type: integer(1)
default: '0'
notnull: true
testo:
type: string(2147483647)
notnull: true
pubblicato:
type: enum(2)
values: [si, 'no']
default: 'no'
notnull: true
testo_eng:
type: string(2147483647)
notnull: true
creato_da_ana_nomi_id:
type: integer(4)
notnull: true
primary: true
aggiornato_da_ana_nomi_id:
type: integer(4)
notnull: true
primary: true
ana_nomi_id: integer(4)
musica_gruppi_id: integer(4)
musica_dischi_id: integer(4)
voto_disco: float(3)
relations:
AnaNomiCreatoDa:
class: AnaNomi
local: creato_da_ana_nomi_id
foreign: id
type: one
AnaNomiAggiornatoDa:
class: AnaNomi
local: aggiornato_da_ana_nomi_id
foreign: id
type: one
If I add in the I18n of "MusicaRecensioni" table the following row:
I18n:
fields: [testo, pubblicato, creato_il, aggiornato_il,
creato_da_ana_nomi_id, aggiornato_da_ana_nomi_id]
I have the following error:
$ ./symfony doctrine:build-all-reload
>> doctrine dropping databases
>> doctrine Successfully dropped database f...ion "doctrine" named "xxx"
>> doctrine creating databases
>> doctrine Successfully created database f...ion "doctrine" named "xxx"
>> doctrine generating model classes
>> doctrine generating sql for models
While exporting model class 'MusicaRecensioni' to SQL: Couldn't find
class AnaNomiCreatoDa
Where is the problem?
Following the schema that generates error
AnaNomi:
tableName: ana_nomi
actAs:
Timestampable:
created:
name: creato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
updated:
name: aggiornato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
Sluggable:
fields: [nome, cognome]
I18n:
fields: [scheda, creato_il, aggiornato_il]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
cognome:
type: string(30)
default: ''
notnull: true
nome: string(30)
scheda: string(2147483647)
scheda_ita: string(2147483647)
data_nascita: date(25)
creato_da_ana_nomi_id: integer(4)
aggiornato_da_ana_nomi_id: integer(4)
MusicaRecensioni:
tableName: musica_recensioni
actAs:
Timestampable:
created:
name: creato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
updated:
name: aggiornato_il
type: timestamp
format: Y-m-d H:i:s
options:
notnull: true
I18n:
fields: [testo, pubblicato, creato_il, aggiornato_il,
creato_da_ana_nomi_id, aggiornato_da_ana_nomi_id]
columns:
id:
type: integer(4)
primary: true
autoincrement: true
no_in_home_page:
type: integer(1)
default: '0'
notnull: true
testo:
type: string(2147483647)
notnull: true
pubblicato:
type: enum(2)
values: [si, 'no']
default: 'no'
notnull: true
testo_eng:
type: string(2147483647)
notnull: true
creato_da_ana_nomi_id:
type: integer(4)
notnull: true
primary: true
aggiornato_da_ana_nomi_id:
type: integer(4)
notnull: true
primary: true
ana_nomi_id: integer(4)
musica_gruppi_id: integer(4)
musica_dischi_id: integer(4)
voto_disco: float(3)
relations:
AnaNomiCreatoDa:
class: AnaNomi
local: creato_da_ana_nomi_id
foreign: id
type: one
AnaNomiAggiornatoDa:
class: AnaNomi
local: aggiornato_da_ana_nomi_id
foreign: id
type: one
Thanks in advance for the help
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---