More attribute => aspect changes. Add get_all_attributes_list, which returns a list of the names of all attributes.
This commit is contained in:
parent
d4f31870a3
commit
60375516ab
4 changed files with 26 additions and 9 deletions
|
|
@ -72,7 +72,7 @@ sub init_meta {
|
|||
|
||||
=head2 property ( $name, %options )
|
||||
|
||||
Extends WebGUI::Definition::property to copy the tableName attribute from the
|
||||
Extends WebGUI::Definition::property to copy the tableName aspect from the
|
||||
meta class into the options for each property.
|
||||
|
||||
=head3 $name
|
||||
|
|
|
|||
|
|
@ -46,9 +46,26 @@ These methods are available from this class:
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 get_all_attributes_list ( )
|
||||
|
||||
Returns an array of all attribute names across all meta classes.
|
||||
|
||||
=cut
|
||||
|
||||
sub get_all_attributes_list {
|
||||
my $self = shift;
|
||||
my @attributes = ();
|
||||
CLASS: foreach my $meta ($self->get_all_class_metas) {
|
||||
push @attributes, $meta->get_attribute_list;
|
||||
}
|
||||
return @attributes;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 get_all_class_metas ( )
|
||||
|
||||
Returns an array of all class meta objects for the classes in this class,
|
||||
Returns an array of all WebGUI::Definition::Meta::Class objects for the classes in this class,
|
||||
in the order they were created in the Definition.
|
||||
|
||||
=cut
|
||||
|
|
@ -108,7 +125,7 @@ sub get_all_property_list {
|
|||
=head2 get_attributes ( )
|
||||
|
||||
Returns an array of all attributes, but only for this class. This is the
|
||||
API-safe way of doing $self->_attribute_map;
|
||||
API-safe way of doing values %{ $self->_attribute_map };
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ sub get {
|
|||
}
|
||||
return undef;
|
||||
}
|
||||
my %properties = map { $_ => scalar $self->$_ } $self->meta->get_property_list;
|
||||
my %properties = map { $_ => scalar $self->$_ } $self->meta->get_all_attributes_list;
|
||||
return \%properties;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue