diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-12-26 10:56:26 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-12-26 10:56:26 +0100 |
commit | 4f5e6f19ffb41f612a8352c2683aecad6f617ef3 (patch) | |
tree | 8f772048ce2cf9f07c594d81a18505c83ebf8c70 /lib/Travel/Status/DE/IRIS/Result.pm | |
parent | ba87b85170dceb2e07a76a6851a1dd3fc0b030be (diff) |
Result: Add wing_of accessor
Diffstat (limited to 'lib/Travel/Status/DE/IRIS/Result.pm')
-rw-r--r-- | lib/Travel/Status/DE/IRIS/Result.pm | 14 |
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; } |