add a Table class
Rafael Kitover [Tue, 31 May 2011 16:30:27 +0000 (12:30 -0400)]
lib/DBIx/Class/Schema/Loader/Table.pm [new file with mode: 0644]
lib/DBIx/Class/Schema/Loader/TableLike.pm [new file with mode: 0644]

diff --git a/lib/DBIx/Class/Schema/Loader/Table.pm b/lib/DBIx/Class/Schema/Loader/Table.pm
new file mode 100644 (file)
index 0000000..6411388
--- /dev/null
@@ -0,0 +1,32 @@
+package DBIx::Class::Schema::Loader::Table;
+
+use strict;
+use warnings;
+use base 'DBIx::Class::Schema::Loader::TableLike';
+
+=head1 NAME
+
+DBIx::Class::Schema::Loader::Table - Class for Tables in
+L<DBIx::Class::Schema::Loader>
+
+=head1 DESCRIPTION
+
+Inherits from L<DBIx::Class::Schema::Loader::TableLike>.
+
+=head1 SEE ALSO
+
+L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>, L<DBIx::Class::Schema::Loader::TableLike>
+
+=head1 AUTHOR
+
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
+1;
+# vim:et sts=4 sw=4 tw=0:
diff --git a/lib/DBIx/Class/Schema/Loader/TableLike.pm b/lib/DBIx/Class/Schema/Loader/TableLike.pm
new file mode 100644 (file)
index 0000000..366eb43
--- /dev/null
@@ -0,0 +1,48 @@
+package DBIx::Class::Schema::Loader::TableLike;
+
+use strict;
+use warnings;
+use base 'Class::Accessor::Grouped';
+
+=head1 NAME
+
+DBIx::Class::Schema::Loader::TableLike - Base Class for Tables and Views in
+L<DBIx::Class::Schema::Loader>
+
+=head1 METHODS
+
+=head2 name
+
+Name of the object.
+
+=head2 schema
+
+The schema (or owner) of the object.
+
+=cut
+
+__PACKAGE__->mk_group_accessors(simple => qw/
+    name
+    schema
+/);
+
+use overload
+    '""' => 'name';
+
+=head1 SEE ALSO
+
+L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>
+
+=head1 AUTHOR
+
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=cut
+
+1;
+# vim:et sts=4 sw=4 tw=0: