diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-05-19 12:46:39 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-05-19 12:46:39 +0100 |
commit | d44c6e58d1efe505006a38a62b61b1045031dd49 (patch) | |
tree | b9d453c4ca0ae8b3d869d82ec4f1607ff0d7666c /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | d8534c980d298764a0956fb803e7b23f496e9a30 (diff) |
Migrate /reports page (minus RSS).
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index ca13f7130..57bbf5fb8 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -200,4 +200,29 @@ sub confirm { return 1; } +=head2 councils + +Returns an array of councils to which a report was sent. + +=cut + +sub councils { + my $self = shift; + return () unless $self->council; + (my $council = $self->council) =~ s/\|.*$//; + my @council = split /,/, $council; + return @council; +} + +=head2 url + +Returns a URL for this problem report. + +=cut + +sub url { + my $self = shift; + return "/report/" . $self->id; +} + 1; |