ebidtech/geoziplocation

Geo zipcode location

Installs: 7 652

Dependents: 0

Stars: 4

Watchers: 11

Language: PHP

v0.5.9 2014-12-05 12:19 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();
            }
        }