X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FModel%2FDBIC%2FSchema.pm;h=3d843364ad99986569849dda5e17556a9c94840e;hb=3fff2940bc1582318a51091e16d89b2eedc74b45;hp=d5e1b39f71b6d63698ff05d1b475112aa9e2b4a0;hpb=7b23bc39098af1b7b4165155aff470b72de146fa;p=catagits%2FCatalyst-Model-DBIC-Schema.git diff --git a/lib/Catalyst/Model/DBIC/Schema.pm b/lib/Catalyst/Model/DBIC/Schema.pm index d5e1b39..3d84336 100644 --- a/lib/Catalyst/Model/DBIC/Schema.pm +++ b/lib/Catalyst/Model/DBIC/Schema.pm @@ -5,7 +5,7 @@ use mro 'c3'; extends 'Catalyst::Model'; with 'CatalystX::Component::Traits'; -our $VERSION = '0.35'; +our $VERSION = '0.44'; $VERSION = eval $VERSION; use namespace::autoclean; @@ -348,6 +348,13 @@ Unresolved arrayref of traits passed in the config. Traits you used resolved to full class names. +=head1 CONFIGURING YOUR SCHEMA AND RESULTSETS + +See the documentation for +L for instructions on how +to pass config values from your L config to your +L and/or L classes. + =head1 METHODS =head2 new @@ -401,7 +408,8 @@ Shortcut for ->schema->txn_scope_guard =head2 storage Provides an accessor for the connected schema's storage object. -Used often for debugging and controlling transactions. + +See L and L. =cut @@ -432,6 +440,14 @@ has _default_cursor_class => ( has schema => (is => 'rw', isa => Schema); +my $app_class; + +before COMPONENT => sub { + $app_class = ref $_[1] || $_[1]; +}; + +sub app_class { $app_class } + sub BUILD { my ($self, $args) = @_; my $class = $self->_original_class_name; @@ -485,6 +501,8 @@ sub txn_do { shift->schema->txn_do(@_); } sub txn_scope_guard { shift->schema->txn_scope_guard(@_); } +sub storage { shift->schema->storage(@_); } + =head2 setup Called at C time before configuration, but after L is @@ -658,7 +676,7 @@ Pavel I. Shaydo C =head1 COPYRIGHT -Copyright (c) 2006 - 2009 +Copyright (c) 2006 - 2010 the Catalyst::Model::DBIC::Schema L and L as listed above. @@ -670,4 +688,4 @@ under the same terms as Perl itself. =cut 1; -# vim:sts=4 sw=4 et: +# vim:sts=4 sw=4 et tw=80: