Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

DBIx::Class two (or multiple) level has_one

by polettix (Vicar)
on Sep 03, 2016 at 07:44 UTC ( #1171100=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Table PROJECT
       id (primary key for the table)
    ...
       id (primary key for the table)
       account_id (reference to ACCOUNT.id)
       ...
    
  2. or download this
    Quota->belongs_to(account => 'Account');
    Account->belongs_to(project => 'Project');
    
  3. or download this
    my $project_from_quota = $quota->account()->project();
    
  4. or download this
    package Quota;
    sub project { return shift->account()->project() }
    #...
    my $project_from_quota = $quota->project();
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1171100]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2023-06-02 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?