NAME

DBIx::Class::Result::ColumnData - Result::ColumnData component for DBIx::Class

This module is used to extract column data only from a data object base on DBIx::Class::Core

It defined relationships methods to extract columns data only of relationships

VERSION

Version 0.09

SYNOPSIS

in your DBIx::Class::Core base class declare Result::ColumnData component

Package::Schema::Result::MyClass;

use strict;
use warning;

__PACKAGE__->load_component(qw/ ... Result::DataColumn /);

#Declare here associations before register_relationships_column_data
__PACKAGE__->belongs_to(...);
__PACKAGE__->has_many(...);

__PACKAGE__->register_relationships_column_data();

you will use get_column_data functions on instance of MyClass

$my_class->get_column_data
$my_class->I<relationships>_column_data

get_column_data

return only column_data from an object DBIx::Class::Core

register_relationships_column_data

declare functions for each relationship on canva : relationship_column_data which return a hash columns data for a single relationship and an list of hash columns data for multi relationships

Package::Schema::Result::Keyboard->belongs_to( computer => "Package::Schema::Result::Computer", computer_id);
Package::Schema::Result::Keyboard->has_many( keys => "Package::Schema::Result::Key", keyboard_id);

register_relationships_column_data generate instance functions for Keyboard object

$keybord->keys_column_data()

# return 
#     [
#       { id => 1, value => 'A', azerty_position => 1},
#       { id => 2, value => 'B', azerty_position => 25},
#       ....
#     ];

$keybord->cumputer_column_data()

# return 
#    { id => 1, os => 'ubuntu' };

AUTHOR

Nicolas Oudard, <nicolas@oudard.org>

BUGS

Please report any bugs or feature requests to bug-dbix-class-result-columndata at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-Result-ColumnData. 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 DBIx::Class::Result::ColumnData

LICENSE AND COPYRIGHT

Copyright 2010 Nicolas Oudard.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.