move get_tables back into Meta/Class. Refactor it to use get_all_class_metas instead of iterating over all the properties.

This commit is contained in:
Colin Kuskie 2010-01-07 18:25:45 -08:00
parent 15c5318a27
commit 49992dddb9
2 changed files with 20 additions and 21 deletions

View file

@ -95,25 +95,4 @@ An integer, representing how difficult the Asset will be to use. The default ui
=cut
#-------------------------------------------------------------------
=head2 get_tables ( )
Returns an array of the names of all tables in every class used by
this Class.
=cut
sub get_tables {
my $self = shift;
my @properties = ();
my %seen = ();
push @properties,
grep { ! $seen{$_}++ }
map { $_->tableName }
$self->get_all_properties
;
return @properties;
}
1;

View file

@ -124,6 +124,26 @@ sub get_property_list {
#-------------------------------------------------------------------
=head2 get_tables ( )
Returns an array of the names of all tables in every class used by this class.
=cut
sub get_tables {
my $self = shift;
my @properties = ();
my %seen = ();
push @properties,
grep { ! $seen{$_}++ }
map { $_->tableName }
$self->get_all_class_metas
;
return @properties;
}
#-------------------------------------------------------------------
=head2 property_meta ( )
Returns the name of the class for properties.