delete Core::View and ResultSourceProxy::View, fix ResultSource::View
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource / View.pm
1 package DBIx::Class::ResultSource::View;
2
3 use strict;
4 use warnings;
5
6 use DBIx::Class::ResultSet;
7
8 use base qw/DBIx::Class/;
9 __PACKAGE__->load_components(qw/ResultSource/);
10 __PACKAGE__->mk_group_accessors(
11   'simple' => qw(is_virtual view_definition)
12 );
13
14 =head1 NAME
15
16 DBIx::Class::ResultSource::Table - Table object
17
18 =head1 SYNOPSIS
19
20 =head1 DESCRIPTION
21
22 Table object that inherits from L<DBIx::Class::ResultSource>
23
24 =head1 METHODS
25
26 =head2 is_virtual
27
28 Attribute to declare a view as virtual.
29
30 =head2 from
31
32 Returns the FROM entry for the table (i.e. the view name)
33 or the definition if this is a virtual view.
34
35 =cut
36
37 sub from {
38   my $self = shift;
39   return \"(${\$self->view_definition})" if $self->is_virtual;
40   return $self->name;
41 }
42
43 1;
44
45 =head1 AUTHORS
46
47 Matt S. Trout <mst@shadowcatsystems.co.uk>
48
49 With Contributions from:
50
51 Guillermo Roditi E<lt>groditi@cpan.orgE<gt>
52
53 =head1 LICENSE
54
55 You may distribute this code under the same terms as Perl itself.
56
57 =cut
58