Revert "Calls to set() and update() set attributes as well as "properties"."
This reverts commit 57fe0721ab.
This commit is contained in:
parent
c31fee588c
commit
483acbc382
2 changed files with 5 additions and 21 deletions
|
|
@ -85,23 +85,13 @@ is not an attribute of the object, then it is silently ignored.
|
|||
=cut
|
||||
|
||||
sub set {
|
||||
|
||||
my $self = shift;
|
||||
my $properties = @_ % 2 ? shift : { @_ };
|
||||
my %seen;
|
||||
|
||||
my @settable = grep { ! $seen{$_}++ } (
|
||||
$self->getProperties, # $self->meta->get_all_property_list, # same as $self->getProperties
|
||||
$self->getReadableAttributes,
|
||||
);
|
||||
|
||||
for my $attribute ( @settable ) {
|
||||
next unless exists $properties->{$attribute};
|
||||
$self->$attribute( $properties->{$attribute} );
|
||||
my @orderedProperties = $self->getProperties;
|
||||
KEY: for my $property ( @orderedProperties ) {
|
||||
next KEY unless exists $properties->{$property};
|
||||
$self->$property($properties->{$property});
|
||||
}
|
||||
|
||||
# ignore unknown properties
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -191,10 +181,5 @@ sub getProperties {
|
|||
return $self->meta->get_all_property_list;
|
||||
}
|
||||
|
||||
sub getReadableAttributes {
|
||||
my $self = shift;
|
||||
return map $_->name, grep $_->has_accessor || $_->has_writer, $self->meta->get_all_attributes;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue