Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

DBIx::Class two (or multiple) level has_one

by polettix (Vicar)
on Sep 03, 2016 at 07:44 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-07-19 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.