aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Body.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-09-22 19:24:10 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-09 16:58:20 +0000
commit8b43050c549bc3bb233bab2b7bd5652dfbb39a12 (patch)
tree4609e33de0a3de95e88e831d83dae2dcbb763c07 /perllib/FixMyStreet/DB/Result/Body.pm
parent491eb26e463c5976a159060782c0217cf450d4fc (diff)
Refactor SendReport::Open311 to use cobrand hooks.
Avoid doing cobrand-specific logic within SendReport::Open311. The hooks defined are: open311_config: set extra fields open311_pre_send: set endpoints and munge data These are tested in the new t/app/sendreport/open311.t, which does not send any actual reports, but just checks that all the data is munged into the expected format. (tests under t/open311* should already test the actual sending) Remove unused Open311 special cases.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Body.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index 037b69352..6dac8821c 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -127,4 +127,19 @@ sub areas {
return \%ids;
}
+=head2 get_cobrand_handler
+
+Get a cobrand object for this body, if there is one.
+
+e.g.
+ * if the problem was sent to Bromley it will return ::Bromley
+ * if the problem was sent to Camden it will return nothing
+
+=cut
+
+sub get_cobrand_handler {
+ my $self = shift;
+ return FixMyStreet::Cobrand->body_handler($self->areas);
+}
+
1;