1SQL::Translator::SchemaU:s:eVrieCwo(n3t)ributed Perl DocSuQmLe:n:tTartainosnlator::Schema::View(3)
2
3
4

NAME

6       SQL::Translator::Schema::View - SQL::Translator view object
7

SYNOPSIS

9         use SQL::Translator::Schema::View;
10         my $view   = SQL::Translator::Schema::View->new(
11             name   => 'foo',                      # name, required
12             sql    => 'select id, name from foo', # SQL for view
13             fields => 'id, name',                 # field names in view
14         );
15

DESCRIPTION

17       "SQL::Translator::Schema::View" is the view object.
18

METHODS

20       new
21
22       Object constructor.
23
24         my $view = SQL::Translator::Schema::View->new;
25
26       fields
27
28       Gets and set the fields the constraint is on.  Accepts a string, list
29       or arrayref; returns an array or array reference.  Will unique the
30       field names and keep them in order by the first occurrence of a field
31       name.
32
33         $view->fields('id');
34         $view->fields('id', 'name');
35         $view->fields( 'id, name' );
36         $view->fields( [ 'id', 'name' ] );
37         $view->fields( qw[ id name ] );
38
39         my @fields = $view->fields;
40
41       is_valid
42
43       Determine whether the view is valid or not.
44
45         my $ok = $view->is_valid;
46
47       name
48
49       Get or set the view's name.
50
51         my $name = $view->name('foo');
52
53       order
54
55       Get or set the view's order.
56
57         my $order = $view->order(3);
58
59       sql
60
61       Get or set the view's SQL.
62
63         my $sql = $view->sql('select * from foo');
64
65       schema
66
67       Get or set the view's schema object.
68
69         $view->schema( $schema );
70         my $schema = $view->schema;
71
72       equals
73
74       Determines if this view is the same as another
75
76         my $isIdentical = $view1->equals( $view2 );
77

AUTHOR

79       Ken Y. Clark <kclark@cpan.org>.
80
81
82
83perl v5.8.8                       2007-10-24  SQL::Translator::Schema::View(3)
Impressum