summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-26 10:56:26 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-26 10:56:26 +0100
commit4f5e6f19ffb41f612a8352c2683aecad6f617ef3 (patch)
tree8f772048ce2cf9f07c594d81a18505c83ebf8c70 /lib
parentba87b85170dceb2e07a76a6851a1dd3fc0b030be (diff)
Result: Add wing_of accessor
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/IRIS/Result.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm
index b2fbce5..c44df8c 100644
--- a/lib/Travel/Status/DE/IRIS/Result.pm
+++ b/lib/Travel/Status/DE/IRIS/Result.pm
@@ -118,7 +118,7 @@ Travel::Status::DE::IRIS::Result->mk_ro_accessors(
sched_route_end start
station station_uic
stop_no time train_id train_no transfer type
- unknown_t unknown_o wing_id)
+ unknown_t unknown_o wing_id wing_of)
);
sub is_additional {
@@ -400,8 +400,12 @@ sub set_unscheduled {
sub add_arrival_wingref {
my ( $self, $ref ) = @_;
- $ref->{is_wing} = 1;
+ my $backref = $self;
+
weaken($ref);
+ weaken($backref);
+ $ref->{is_wing} = 1;
+ $ref->{wing_of} = $self;
push( @{ $self->{arrival_wings} }, $ref );
return $self;
}
@@ -409,8 +413,12 @@ sub add_arrival_wingref {
sub add_departure_wingref {
my ( $self, $ref ) = @_;
- $ref->{is_wing} = 1;
+ my $backref = $self;
+
weaken($ref);
+ weaken($backref);
+ $ref->{is_wing} = 1;
+ $ref->{wing_of} = $self;
push( @{ $self->{departure_wings} }, $ref );
return $self;
}