diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-13 10:58:07 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-07-21 17:37:47 +0100 |
commit | ef9850616c71d82980bdf77e001267a89337e1a8 (patch) | |
tree | 22ea4291b7f374589ba75a173027704f5bc0b599 /perllib/FixMyStreet/DB/Result/Problem.pm | |
parent | 17ebb70ee0e1d0452b824d3d8daee7405f5edf5c (diff) |
Refactor map pin/feature functions.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Problem.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index bc72cf9da..2599f24ae 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -892,5 +892,18 @@ has get_cobrand_logged => ( }, ); +sub pin_data { + my ($self, $c, $page, %opts) = @_; + my $colour = $c->cobrand->pin_colour($self, $page); + + { + latitude => $self->latitude, + longitude => $self->longitude, + colour => $colour, + id => $self->id, + title => $opts{private} ? $self->title : $self->title_safe, + problem => $self, + } +} 1; |