From 39bd2db7b822a04b2269b9e4be1772c496af34ec Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@theke.io>
Date: Tue, 8 Oct 2019 12:12:56 -0300
Subject: [PATCH] Bug 23770: Add to_api_mapping method to Koha::City
Content-Type: text/plain; charset=utf-8
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
---
Koha/City.pm | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/Koha/City.pm b/Koha/City.pm
index b84b5c3c7f..8fad9b1691 100644
--- a/Koha/City.pm
+++ b/Koha/City.pm
@@ -29,11 +29,28 @@ Koha::City - Koha City Object class
=head1 API
-=head2 Class Methods
+=head2 Class methods
+
+=head3 to_api_mapping
+
+This method returns the mapping for representing a Koha::City object
+on the API.
=cut
-=head3 type
+sub to_api_mapping {
+ return {
+ cityid => 'city_id',
+ city_country => 'country',
+ city_name => 'name',
+ city_state => 'state',
+ city_zipcode => 'postal_code'
+ };
+}
+
+=head2 Internal methods
+
+=head3 _type
=cut
--
2.11.0