File: Class.pm

package info (click to toggle)
libtangram-perl 2.12-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,308 kB
  • ctags: 734
  • sloc: perl: 10,260; makefile: 9
file content (43 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

package Tangram::Schema::Class;

use strict;

use Tangram::Schema::Node;
use vars qw(@ISA);
 @ISA = qw( Tangram::Schema::Node );

# XXX - not reached by test suite
sub members
{
   my ($self, $type) = @_;
   return @{$self->{$type}};
}

sub is_root
  {
	!@{ shift->{BASES} }
  }

sub get_direct_fields
  {
	map { values %$_ } values %{ shift->{fields} }
  }

# XXX - not reached by test suite
sub get_table { shift->{table} }

*direct_fields = \&get_direct_fields;

sub get_import_cols {
  my ($self, $context) = @_;
  my $table = $self->{table};
  map { map { [ $table, $_ ] } $_->get_import_cols($context) } $self->get_direct_fields()
}

sub get_export_cols {
  my ($self, $context) = @_;
  my $table = $self->{table};
  map { map { [ $table, $_ ] } $_->get_export_cols($context) } $self->get_direct_fields()
}