GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DBIX::CLASS::LOADER::WRITING (3)

.ds Aq ’

NAME

DBIx::Class::Loader::Writing - Loader subclass writing guide

CONTENTS

SYNOPSIS



  package DBIx::Class::Loader::Foo;

  # THIS IS JUST A TEMPLATE TO GET YOU STARTED.

  use strict;
  use base DBIx::Class::Loader::Generic;
  use Carp;

  sub _db_classes {
      return qw/DBIx::Class::PK::Auto::Foo/;
          # You may want to return more, or less, than this.
  }

  sub _tables {
      my $self = shift;
      my $dbh = $self->{storage}->dbh;
      return $dbh->tables; # Your DBD may need something different
  }

  sub _table_info {
      my ( $self, $table ) = @_;
      ...
      return ( \@cols, \@primary );
  }

  sub _relationships {
      my $self = shift;
      ...
      $self->_belongs_to_many($table, $f_key, $f_table, $f_column);
          # For each relationship you want to set up ($f_column is
          # optional, default is $f_tables primary key)
      ...
  }



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DBIX::CLASS::LOADER::WRITING (3) 2006-02-14

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.