Bug 23770: Add to_api_mapping method to Koha::City
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 8 Oct 2019 15:12:56 +0000 (12:12 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 21 Oct 2019 09:03:53 +0000 (10:03 +0100)
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/City.pm

index b84b5c3..8fad9b1 100644 (file)
@@ -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