DBIx-Class
view release on metacpan or search on metacpan
lib/DBIx/Class.pm view on Meta::CPAN
use base qw/DBIx::Class::Componentised DBIx::Class::AccessorGroup/;
use DBIx::Class::StartupCheck;
use DBIx::Class::Exception;
__PACKAGE__->mk_group_accessors(inherited => '_skip_namespace_frames');
__PACKAGE__->_skip_namespace_frames('^DBIx::Class|^SQL::Abstract|^Try::Tiny|^Class::Accessor::Grouped|^Context::Preserve');
# FIXME - this is not really necessary, and is in
# fact going to slow things down a bit
# However it is the right thing to do in order to get
# various install bases to highlight their brokenness
# Remove at some unknown point in the future
sub DESTROY { &DBIx::Class::_Util::detected_reinvoked_destructor }
sub mk_classdata {
shift->mk_classaccessor(@_);
}
sub mk_classaccessor {
my $self = shift;
$self->mk_group_accessors('inherited', $_[0]);
$self->set_inherited(@_) if @_ > 1;
}
sub component_base_class { 'DBIx::Class' }
sub MODIFY_CODE_ATTRIBUTES {
my ($class,$code,@attrs) = @_;
$class->mk_classdata('__attr_cache' => {})
unless $class->can('__attr_cache');
$class->__attr_cache->{$code} = [@attrs];
return ();
}
sub _attr_cache {
my $self = shift;
my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {};
return {
%$cache,
%{ $self->maybe::next::method || {} },
};
}
# *DO NOT* change this URL nor the identically named =head1 below
# it is linked throughout the ecosystem
sub DBIx::Class::_ENV_::HELP_URL () {
'http://p3rl.org/DBIx::Class#GETTING_HELP/SUPPORT'
}
1;
__END__
# This is the only file where an explicit =encoding is needed,
# as the distbuild-time injected author list is utf8 encoded
# Without this pod2text output is less than ideal
#
# A bit regarding selection/compatiblity:
# Before 5.8.7 UTF-8 was == utf8, both behaving like the (lax) utf8 we know today
# Then https://www.nntp.perl.org/group/perl.unicode/2004/12/msg2705.html happened
# Encode way way before 5.8.0 supported UTF-8: https://metacpan.org/source/DANKOGAI/Encode-1.00/lib/Encode/Supported.pod#L44
# so it is safe for the oldest toolchains.
# Additionally we inject all the utf8 programattically and test its well-formedness
# so all is well
#
=encoding UTF-8
=head1 NAME
DBIx::Class - Extensible and flexible object <-> relational mapper.
=head1 WHERE TO START READING
See L<DBIx::Class::Manual::DocMap> for an overview of the exhaustive documentation.
To get the most out of DBIx::Class with the least confusion it is strongly
recommended to read (at the very least) the
L<Manuals|DBIx::Class::Manual::DocMap/Manuals> in the order presented there.
=cut
=head1 GETTING HELP/SUPPORT
Due to the sheer size of its problem domain, DBIx::Class is a relatively
complex framework. After you start using DBIx::Class questions will inevitably
arise. If you are stuck with a problem or have doubts about a particular
approach do not hesitate to contact us via any of the following options (the
list is sorted by "fastest response time"):
=over
=item * RT Bug Tracker: L<https://rt.cpan.org/Public/Dist/Display.html?Name=DBIx-Class>
=item * Email: L<mailto:bug-DBIx-Class@rt.cpan.org>
=item * Twitter: L<https://twitter.com/intent/tweet?text=%40ribasushi%20%23DBIC>
=back
=head1 SYNOPSIS
For the very impatient: L<DBIx::Class::Manual::QuickStart>
This code in the next step can be generated automatically from an existing
database, see L<dbicdump> from the distribution C<DBIx-Class-Schema-Loader>.
=head2 Schema classes preparation
Create a schema class called F<MyApp/Schema.pm>:
package MyApp::Schema;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_namespaces();
1;
Create a result class to represent artists, who have many CDs, in
F<MyApp/Schema/Result/Artist.pm>:
See L<DBIx::Class::ResultSource> for docs on defining result classes.
( run in 1.805 second using v1.01-cache-2.11-cpan-39bf76dae61 )