Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
DBIx::Class::Loader::WUsernContributed Perl DocDBIx::Class::Loader::Writing(3)

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

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_table's primary key)
	     ...
	 }

perl v5.32.1			  2006-02-14   DBIx::Class::Loader::Writing(3)

NAME | SYNOPSIS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=DBIx::Class::Loader::Writing&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help