Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
XP is just a number

Comment on


UPDATE: I was being brain dead, but leaving this question up because I see no way to delete it...

If I have 3 tables (league, team and league_team), with the following relationships:

league has one to many league_team
team has one to many league_team

with league,team being the PK on the league_team table.

What I want to build is so the following will work (say) for a league):

while (my $team = $league->teams->next ) { ... }

With my current relationship across the three tables though, I have to use this:

while (my $team_league = $league->team_league->next ) { my $team = $team_league->team; ... }

I'm guessing also, that there's going to need to be an implicit create on the league_team entry wrapped in the term:


I can easily hack the interface I want, but I'm assuming that there is a correct way to do this in DBIx::Class. What is it? Anyone got a working example I can look at for inspiration?

Oh, I found this module, but I'm not quite getting it, if that is indeed the solution.

Note, refactoring the tables is not something I have access to right now.

Edit: I think I've found the term I was looking for - relationship_bridge. Now I just need to find an example, heh. The hardest part of any quest is working out what you're looking for, heh

In reply to DBIx::Class - shortcutting relationships [resolved] by cLive ;-)

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (5)
    As of 2014-03-16 13:10 GMT
    Find Nodes?
      Voting Booth?

      Have you used a cryptocurrency?

      Results (326 votes), past polls