Add test files and test for vie
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource / View.pm
index 2779492..e14bc7f 100644 (file)
@@ -11,12 +11,6 @@ __PACKAGE__->mk_group_accessors(
   'simple' => qw(is_virtual view_definition depends_on)
 );
 
-sub new {
-  my $new = shift->next::method(@_);
-  $new->{depends_on} = { %{$new->{depends_on}||{}} };
-  return $new;
-}
-
 =head1 NAME
 
 DBIx::Class::ResultSource::View - ResultSource object representing a view
@@ -25,9 +19,8 @@ DBIx::Class::ResultSource::View - ResultSource object representing a view
 
   package MyDB::Schema::Result::Year2000CDs;
 
-  use base qw/DBIx::Class/;
+  use base qw/DBIx::Class::Core/;
 
-  __PACKAGE__->load_components('Core');
   __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
 
   __PACKAGE__->table('year2000cds');
@@ -137,9 +130,21 @@ database-based view.
 An SQL query for your view. Will not be translated across database
 syntaxes.
 
-
 =head1 OVERRIDDEN METHODS
 
+=head2 new
+
+The constructor. This is a private method, as only other DBIC modules
+should call this. See L<DBIx::Class::ResultSource::MultipleTableInheritance>.
+
+=cut
+
+sub new {
+  my $new = shift->next::method(@_);
+  $new->{depends_on} = { %{$new->{depends_on}||{}} };
+  return $new;
+}
+
 =head2 from
 
 Returns the FROM entry for the table (i.e. the view name)
@@ -153,6 +158,17 @@ sub from {
   return $self->name;
 }
 
+=head1 PRIVATE METHODS
+
+=head2 depends_on
+
+An internal method for the construction of a hashref of the view's
+superclasses, e.g., the sources that comprise it.
+
+See L<DBIx::Class::ResultSource::MultipleTableInheritance>.
+
+=cut
+
 1;
 
 =head1 AUTHORS