aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-05-19 12:46:39 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-05-19 12:46:39 +0100
commitd44c6e58d1efe505006a38a62b61b1045031dd49 (patch)
treeb9d453c4ca0ae8b3d869d82ec4f1607ff0d7666c /perllib/FixMyStreet/DB/Result/Problem.pm
parentd8534c980d298764a0956fb803e7b23f496e9a30 (diff)
Migrate /reports page (minus RSS).
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm25
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;