From 49992dddb95972d1ad0733dcdda41db7b7bbb3ec Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 7 Jan 2010 18:25:45 -0800 Subject: [PATCH] move get_tables back into Meta/Class. Refactor it to use get_all_class_metas instead of iterating over all the properties. --- lib/WebGUI/Definition/Meta/Asset.pm | 21 --------------------- lib/WebGUI/Definition/Meta/Class.pm | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/WebGUI/Definition/Meta/Asset.pm b/lib/WebGUI/Definition/Meta/Asset.pm index aab5d583a..21f9106dc 100644 --- a/lib/WebGUI/Definition/Meta/Asset.pm +++ b/lib/WebGUI/Definition/Meta/Asset.pm @@ -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; diff --git a/lib/WebGUI/Definition/Meta/Class.pm b/lib/WebGUI/Definition/Meta/Class.pm index a01f5abf2..351f17765 100644 --- a/lib/WebGUI/Definition/Meta/Class.pm +++ b/lib/WebGUI/Definition/Meta/Class.pm @@ -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.