X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=024e81dab7205a3d9d4c887890ac6b3794a6523c;hb=b979420a9fa5c170a4b926882051f800c132750b;hp=c9057306e8c268ec1ea519ba15aaacffe2d7b363;hpb=8637bb249bdda94dbbe47ad898cde0b7e89bad20;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index c905730..024e81d 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -5,7 +5,7 @@ use warnings; use DBIx::Class::Exception; use Carp::Clan qw/^DBIx::Class/; -use Scalar::Util qw/weaken/; +use Scalar::Util (); use File::Spec; use Sub::Name (); use Module::Find(); @@ -33,8 +33,9 @@ DBIx::Class::Schema - composable schemas __PACKAGE__->load_namespaces(); package Library::Schema::Result::CD; - use base qw/DBIx::Class/; - __PACKAGE__->load_components(qw/Core/); # for example + use base qw/DBIx::Class::Core/; + + __PACKAGE__->load_components(qw/InflateColumn::DateTime/); # for example __PACKAGE__->table('cd'); # Elsewhere in your code: @@ -1082,7 +1083,7 @@ sub deployment_statements { $self->storage->deployment_statements($self, @_); } -=head2 create_ddl_dir (EXPERIMENTAL) +=head2 create_ddl_dir =over 4 @@ -1177,8 +1178,17 @@ sub freeze { =head2 dclone -Recommeneded way of dcloning objects. This is needed to properly maintain -references to the schema object (which itself is B cloned.) +=over 4 + +=item Arguments: $object + +=item Return Value: dcloned $object + +=back + +Recommended way of dcloning L and L +objects so their references to the schema object +(which itself is B cloned) are properly maintained. =cut @@ -1259,6 +1269,24 @@ sub register_source { $self->_register_source(@_); } +=head2 unregister_source + +=over 4 + +=item Arguments: $moniker + +=back + +Removes the L from the schema for the given moniker. + +=cut + +sub unregister_source { + my $self = shift; + + $self->_unregister_source(@_); +} + =head2 register_extra_source =over 4 @@ -1285,7 +1313,7 @@ sub _register_source { $source = $source->new({ %$source, source_name => $moniker }); $source->schema($self); - weaken($source->{schema}) if ref($self); + Scalar::Util::weaken($source->{schema}) if ref($self); my $rs_class = $source->result_class;