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