diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-30 16:24:41 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-11-02 11:41:52 +0000 |
commit | 96c9b73552ceb6d35f879dc212ee0fcc1cdcd6da (patch) | |
tree | c05ede9d8c2b92743f489a44da43ee9fab1b3d90 /perllib/Open311/GetServiceRequestUpdates.pm | |
parent | 321ad0d6742f6fa9cf53bfa4d88bf9cbabfc4b83 (diff) |
allow comment fetching to be limited by body name
Allows creating scripts that fetch comments for a single body, e.g for
batch updating or because they require special setup.
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 20212bc95..60b37736c 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -9,6 +9,7 @@ use DateTime::Format::W3CDTF; has system_user => ( is => 'rw' ); has start_date => ( is => 'ro', default => sub { undef } ); has end_date => ( is => 'ro', default => sub { undef } ); +has body => ( is => 'ro', default => sub { undef } ); has suppress_alerts => ( is => 'rw', default => 0 ); has verbose => ( is => 'ro', default => 0 ); has schema => ( is =>'ro', lazy => 1, default => sub { FixMyStreet::DB->schema->connect } ); @@ -29,6 +30,10 @@ sub fetch { } ); + if ( $self->body ) { + $bodies = $bodies->search( { name => $self->body } ); + } + while ( my $body = $bodies->next ) { my %open311_conf = ( |