BazingaGeocoderBundle icon indicating copy to clipboard operation
BazingaGeocoderBundle copied to clipboard

Allow stringable object to be used to geocode address

Open ker0x opened this issue 1 year ago • 2 comments
trafficstars

Currently, only addresses in string form can be geocoded. It would be interesting to enable objects that can be represented as strings (with a __toString() method or by implementing the \Stringable interface) to be geocoded too.

ker0x avatar Jan 29 '24 00:01 ker0x

Is this limitation exists only in this bundle?

norkunas avatar Jan 29 '24 04:01 norkunas

I think so, because I was referring to the GeocoderListener which only checks a property or a getter returning a string.

In my case, I store the address in an embeddable doctrine object which implements the Stringable interface. I could simply add a getAddressAsString method with the Address attribute, but having the ability to directly mark my getAddress() getter would be a nice improvement.

I'll be able to work on a PR when I've finished fighting the test failure!

ker0x avatar Jan 29 '24 08:01 ker0x