Skip to content

ebidtech/geoziplocation

Repository files navigation

geoziplocation

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();
            }
        }