K
K
Konstantin2012-02-23 23:22:53
symfony
Konstantin, 2012-02-23 23:22:53

Symfony 1.4/Propel - problem with complex relationships

Hello. I returned to development on symphony after a long break and immediately ran into a problem that I could not solve myself and did not google anything.
So, there is a data schema: With such a schema, I cannot generate a basic CRUD for the users_to_offer model. So far I can't figure out how to deal with this situation. It would be great if Habr prompted me to solve this problem, which so far is very much slowing down the development of my project. Thanks
#некое периодическое событие, допустим, музыкальный фестиваль
event:
id: ~
name: {
type: LONGVARCHAR,
required: true
}

#информация о дате начала очередного фестиваля в Москве
event_offer:
id: ~
event_id: {
type: INTEGER,
size: 11,
primaryKey: true,
required: true,
foreignTable: event,
foreignReference: id,
onDelete: RESTRICT,
onUpdate: RESTRICT
}
start: {
type: TIMESTAMP,
required: true
}

#информация о пользователях, купивших билеты на этот фестиваль
users_to_offer:
id: ~
user_id: {
type: INTEGER,
size: 11,
required: true,
foreignTable: sf_guard_user,
foreignReference: id,
onDelete: CASCADE,
onUpdate: RESTRICT
}
offer_id: {
type: INTEGER,
size: 11,
required: true,
foreignTable: event_offer,
foreignReference: id,
onDelete: CASCADE,
onUpdate: RESTRICT
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question