Force set to process properties in insertion order.
Note, we should look for a way to make this more efficient.
This commit is contained in:
parent
8837185bce
commit
030f6bccf0
2 changed files with 39 additions and 3 deletions
|
|
@ -86,9 +86,10 @@ is not an attribute of the object, then it is silently ignored.
|
|||
sub set {
|
||||
my $self = shift;
|
||||
my $properties = @_ % 2 ? shift : { @_ };
|
||||
KEY: for my $key ( keys %$properties ) {
|
||||
next KEY unless $self->meta->find_attribute_by_name($key);
|
||||
$self->$key($properties->{$key});
|
||||
my @orderedProperties = $self->getProperties;
|
||||
KEY: for my $property ( @orderedProperties ) {
|
||||
next KEY unless exists $properties->{$property};
|
||||
$self->$property($properties->{$property});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue