Renee Baecker > FabForce-DBDesigner4-DBIC-0.06 > FabForce::DBDesigner4::DBIC

Download:
FabForce-DBDesigner4-DBIC-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.06   Source   Latest Release: FabForce-DBDesigner4-DBIC-0.07

NAME ^

FabForce::DBDesigner4::DBIC - create DBIC scheme for DBDesigner4 xml file

VERSION ^

Version 0.05

SYNOPSIS ^

    use FabForce::DBDesigner4::DBIC;

    my $foo = FabForce::DBDesigner4::DBIC->new();
    $foo->output_path( $some_path );
    $foo->namespace( 'MyApp::DB' );
    $foo->create_scheme( $xml_document );

METHODS ^

new

creates a new object of FabForce::DBDesigner4::DBIC. You can pass some parameters to new (all parameters are optional)

  my $foo = FabForce::DBDesigner4::DBIC->new(
    output_path => '/path/to/dir',
    input_file  => '/path/to/dbdesigner.file',
    namespace   => 'MyApp::Database',
  );

output_path

sets / gets the output path for the scheme

  $foo->output_path( '/any/directory' );
  print $foo->output_path;

input_file

sets / gets the name of the DBDesigner file (XML format)

  $foo->input_file( 'dbdesigner.xml' );
  print $foo->input_file;

create_scheme

creates all the files that are needed to work with DBIx::Class scheme:

The main module that loads all classes and one class per table. If you haven't specified an input file, the module will croak.

You can specify the input file either with input_file or as an parameter for create_scheme

  $foo->input_file( 'dbdesigner.xml' );
  $foo->create_scheme;
  
  # or
  
  $foo->create_scheme( 'dbdesigner.xml' );

namespace

sets / gets the name of the namespace. If you set the namespace to 'Test' and you have a table named 'MyTable', the main module is named 'Test::DBIC_Scheme' and the class for 'MyTable' is named 'Test::DBIC_Scheme::MyTable'

  $foo->namespace( 'MyApp::DB' );

prefix

In relationships the accessor for the objects of the "other" table shouldn't have the name of the column. Otherwise it is very clumsy to get the orginial value of this table.

  $foo->prefix( 'belongs_to' => 'fk_' );
  $foo->prefix( 'has_many' => 'has_' );

creates (col1 is the column name of the foreign key)

  __PACKAGE__->belongs_to( 'fk_col1' => 'OtherTable', {'foreign.col1' => 'self.col1' } );

AUTHOR ^

Renee Baecker, <module at renee-baecker.de>

BUGS ^

Please report any bugs or feature requests to bug-fabforce-dbdesigner4-dbic at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FabForce::DBDesigner4::DBIC. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc FabForce::DBDesigner4::DBIC

You can also look for information at:

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

Copyright 2007 Renee Baecker, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.