diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-19 12:56:27 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-19 12:56:27 +0100 |
commit | 19f27c24d9dbe6f83a6778f949a35f73514f73b6 (patch) | |
tree | fb34a44726891ddf8e2d9db6ad6e7eaf3d01f0a7 /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | 109b706b68d85708dd023faedd8065efc3839a85 (diff) | |
parent | d44c6e58d1efe505006a38a62b61b1045031dd49 (diff) |
Merge branch 'migrate_to_catalyst' of ssh://git.mysociety.org/data/git/public/fixmystreet into migrate_to_catalyst
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; |