aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/Nearby.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Nearby.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/Nearby.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Nearby.pm b/perllib/FixMyStreet/DB/Result/Nearby.pm
new file mode 100644
index 000000000..d3d228788
--- /dev/null
+++ b/perllib/FixMyStreet/DB/Result/Nearby.pm
@@ -0,0 +1,33 @@
+package FixMyStreet::DB::Result::Nearby;
+
+# Thanks to http://www.perlmonks.org/?node_id=633800
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+use Moose;
+use namespace::clean -except => [ 'meta' ];
+
+__PACKAGE__->table( 'NONE' );
+__PACKAGE__->add_columns(
+ "problem_id",
+ { data_type => "integer", is_nullable => 0 },
+ "distance",
+ { data_type => "double precision", is_nullable => 0 },
+);
+__PACKAGE__->belongs_to(
+ "problem",
+ "FixMyStreet::DB::Result::Problem",
+ { id => "problem_id" },
+ { is_deferrable => 1 },
+);
+
+# Make a new ResultSource based on the User class
+__PACKAGE__->result_source_instance
+ ->name( \'problem_find_nearby(?,?,?)' );
+
+# we need the inline_constructor bit as we don't inherit from Moose
+__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
+
+1;