Hello Symfonians,

using doctrine i like to sort many-to-many relation.

Example:

Article has many Actor
Actor has many Article

But the "Best" actor should display first when reading the article.
(When you read an article about James Bond "Goldfinger" than Sean Connery
should be named bevor Shirley Eaton)

So my schema.yml is:

Article:
  actAs:
    Timestampable: ~
  columns:
    title: string(255)
    text: clob
    .... and many more fields
  relations:
    Actors:
      class:  Actor
      local:  article_id
      foreign:  actor_id
      refClass: ArticleActor
      foreignAlias: Actors

Actor:
  actAs:
    Timestampable: ~
  columns:
    first_name:
      type: string(255)
      notnull:  true
    last_name:
      type: string(255)
      notnull: true

ArticleActor:
  columns:
    article_id:
      type: integer
      primary:  true
    actor_id:
      type: integer
      primary:  true
    *rank: integer(11)*
  relations:
    Article:
      onDelete: CASCADE
      local:  article_id
      foreign:  id
    Actor:
      onDelete: CASCADE
      local:  actor_id
      foreign:  id

And now the Question:

How can I save tne "rank" field in the ArticleActor class when I'm adding a
new article?

Thanks for any help, Kai

--~--~---------~--~----~------------~-------~--~----~
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