Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    DBIx::Class::Result::ExternalAttribute 0.06

    Download button

    No screenshots available
    Downloads: 150  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Nicolas Oudard | More programs
    Perl Artistic License / FREE
    March 7th, 2012, 12:34 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    DBIx::Class::Result::ExternalAttribute description

    The great new DBIx::Class::Result::ExternalAttribute!

    DBIx::Class::Result::ExternalAttribute is a Perl module.

    SYNOPSIS

    use attached model to store attribute.

    for example artist result:

     package t::app::Main::Result::Artist;
     use base qw/DBIx::Class::Core/;
     __PACKAGE__->table('artist');
     __PACKAGE__->add_columns(
     "id",
     { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
     "name",
     { data_type => "varchar",
     default_value => "",
     is_nullable => 0,
     size => 255
     });
     __PACKAGE__->set_primary_key('id');

     __PACKAGE__->load_components(qw/ Result::ExternalAttribute Result::ColumnData /);
     __PACKAGE__->init_external_attribute(
     artist_attribute =>
     't::app::Main::Result::ArtistAttribute',
     'artist_id'
     );
     __PACKAGE__->register_relationships_column_data();


    use a artist attribute result:

     package t::app::Main::Result::ArtistAttribute;
     use base qw/DBIx::Class::Core/;
     __PACKAGE__->table('artist_attribute');
     __PACKAGE__->add_columns(
     "artist_id",
     { data_type => "integer", is_nullable => 0 },
     "year_old",
     { data_type => "integer", is_nullable => 1});
     __PACKAGE__->set_primary_key('artist_id');
     __PACKAGE__->load_components(qw/ Result::ColumnData /);
     __PACKAGE__->belongs_to( artist => "t::app::Main::Result::Artist", 'artist_id');

     1;


    with this configuration, you can call methods:

     $artist->get_column_data => get only columns of artist result

     $artist->get_column_data_with_attribute => get columns of Artist and ArtistAttribute result except artist_id

     #update with artist attributes
     $artist->update({name => "Me", year_old => 15});

     #create with artist attributes
     my $rh = t::app::Main::Result::Artist->prepare_params_with_attribute({name => "Me", year_old => 15});
     $schema->resultset('Artist')->create($rh);



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    external attribute | Perl module | Perl | external | attribute

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM