Tom,

Thank you for the reply, but I don't think that is the problem.

1. The relation between my Command and Event, is only defined in one side,
the Event
  relations:
    Command:
      local: command_id
      foreign: id
      type: many
      cascade: [delete]
      foreignAlias: Events

2. I added the foreignAlias  but that only creates the method  getEvents()
instead of getEvent() ... however, calling getEvents() is only brginging one
record, not a collection of Events.

Since my relation Command to Events, is 1 to manny i should be getting a
collection back...

Any other ideas?

Thank you.


On Mon, Mar 1, 2010 at 9:39 AM, Tom Ptacnik <to...@tomor.cz> wrote:

> You can look etc into the Practical symfony-jobeet-1.4-doctrine-en.pdf
> and there you can see that you have badly set your relations
>
> look on the JobeetJob - JobeetCategory realation
>
> 1) specify the relation only on one side
> 2) specify the foreignAlias: etc JobeetJobs
> ...
>
> JobeetCategory:
>  actAs: { Timestampable: ~ }
>  columns:
>   name: { type: string(255), notnull: true, unique: true }
>
> JobeetJob:
>  actAs: { Timestampable: ~ }
>  columns:
>    category_id: { type: integer, notnull: true }
>    type: { type: string(255) }
>    company: { type: string(255), notnull: true }
>   ...
>  relations:
>    JobeetCategory: { onDelete: CASCADE, local: category_id, foreign:
> id, foreignAlias: JobeetJobs }
>
> On 1 bře, 06:15, Samuel Morhaim <samuel.morh...@gmail.com> wrote:
> > Never mind about this one, but now I am facing one more issue..  Based on
> > the below schema.. why is the 1 to many between Command and Events not
> > working?  I get a method such as $command->getEvent() but it seems to be
> > bringing the first record.. not all records.. i cant find a getEvents()
> > method..
> >
> > Can anyone help?  thank you.
> >
> > Command:
> >   columns:
> >     id:
> >       primary: true
> >       unique: true
> >       type: integer
> >       notnull: true
> >       autoincrement: true
> >     rule_id:
> >       type: integer
> >       notnull: true
> >     command:
> >       type: string(160)
> >       notnull: false
> >   relations:
> >     Rule:
> >       local: rule_id
> >       foreign: id
> >       cascade: [delete]
> >
> > Event:
> >   columns:
> >     id:
> >       primary: true
> >       unique: true
> >       type: integer
> >       notnull: true
> >       autoincrement: true
> >     command_id:
> >       type: integer
> >       notnull: true
> >     name:
> >       type: string(50)
> >       notnull: true
> >     campaign_id:
> >       type: integer
> >       notnull: false
> >     template_id:
> >       type: integer
> >       notnull: false
> >   relations:
> >     Command:
> >       local: command_id
> >       foreign: id
> >       type: many
> >       cascade: [delete]
> >     Campaign:
> >       local: campaign_id
> >       foreign: id
> >       cascade: [delete]
> >     Template:
> >       local: template_id
> >       foreign: id
> >
> > On Sun, Feb 28, 2010 at 2:42 PM, Samuel Morhaim <
> samuel.morh...@gmail.com>wrote:
> >
> >
> >
> > > It is a somewhat complex table relation but it should work..
> >
> > > A rule, can have a command, the command can have many events. I get
> this
> > > error:   Unknown record property / related component "ev1" on "Event"
> >
> > > Fixture:
> > > Rule:
> > >   rule_1:
> > >     id: 1
> > >     type: User
> > >     campaign_id: 1
> > >     msg_to: 32075
> > >     msg_from: Outbound
> > >     description: See if the user replies the number 1 or 2
> > >     Command:
> > >       command_1:
> > >         command: 1
> > >         Event:
> > >           ev1:
> > >             name: Add
> > >           ev2:
> > >             name: Remove
> > >       command_2:
> > >         command: 2
> >
> > > Schema
> >
> > > Rule:
> > >   columns:
> > >     id:
> > >       primary: true
> > >       unique: true
> > >       type: integer
> > >       notnull: true
> > >       autoincrement: true
> > >     type:
> > >       type: enum
> > >       values: [User,System]
> > >     campaign_id:
> > >       type: integer
> > >       notnull: false
> > >     msg_to:
> > >       type: string(20)
> > >       notnull: false
> > >     msg_from:
> > >       type: enum
> > >       values: [Anyone,Outbound]
> > >     description:
> > >       type: string(255)
> > >       notnull: false
> > >     is_active:
> > >       default: true
> > >       type: boolean
> > >       notnull: true
> > >   relations:
> > >     Campaign:
> > >       local: campaign_id
> > >       foreign: id
> > >       type: many
> > >       cascade: [delete]
> >
> > > Command:
> > >   columns:
> > >     id:
> > >       primary: true
> > >       unique: true
> > >       type: integer
> > >       notnull: true
> > >       autoincrement: true
> > >     rule_id:
> > >       type: integer
> > >       notnull: true
> > >     command:
> > >       type: string(160)
> > >       notnull: false
> > >   relations:
> > >     Rule:
> > >       local: rule_id
> > >       foreign: id
> > >       cascade: [delete]
> >
> > > Event:
> > >   columns:
> > >     id:
> > >       primary: true
> > >       unique: true
> > >       type: integer
> > >       notnull: true
> > >       autoincrement: true
> > >     command_id:
> > >       type: integer
> > >       notnull: true
> > >     name:
> > >       type: string(50)
> > >       notnull: true
> > >     campaign_id:
> > >       type: integer
> > >       notnull: false
> > >     template_id:
> > >       type: integer
> > >       notnull: false
> > >   relations:
> > >     Command:
> > >       local: command_id
> > >       foreign: id
> > >       type: many
> > >       cascade: [delete]
> > >     Campaign:
> > >       local: campaign_id
> > >       foreign: id
> > >       cascade: [delete]
> > >     Template:
> > >       local: template_id
> > >       foreign: id
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to