ebidtech/geoziplocation

Geo zipcode location

v0.6 2021-05-26 20:35 UTC

README

Build Status

Given zipcode returns location

Sample USAGE:

        $myFactory = new TranslatorFactory();
        $ptTranslator = $myFactory->create('PT');

        $region = $ptTranslator->getLocationForZip('4730');
        $region->getType(); //returns "region"
        $region->getName(); //returns "Norte"
        $region->getId();

        if ($region->hasSubLocation()) {
            $zone = $region->getSubLocation();
            $zone->getType(); //returns "zone"
            $zone->getName(); //returns "Braga"
            $zone->getId();

            if ($zone->hasSubLocation()) {
                $area = $zone->getSubLocation();
                $area->getType(); //returns "area"
                $area->getName(); //returns "Vila Verde"
                $area->getId();
            }
        }