public function getPostalCodes($elementIdx = 0)
    {
        if (true === array_key_exists($elementIdx, $this->postalCodes)) {
            return $this->postalCodes[$elementIdx];
        }

        if (false === array_key_exists($elementIdx, $this->response['elements'])) {
            throw new \Exception('Oups...');
        }

        if (true === array_key_exists('addr:postcode', $this->response['elements'][$elementIdx]['tags'])) {
            $postcode = $this->response['elements'][$elementIdx]['tags']['addr:postcode'];
            $this->postalCodes[$elementIdx] = explode(';', $postcode);

            // Ok... let's free a little bit of memory
            unset($this->response['elements'][$elementIdx]['tags']['addr:postcode']);
        } else {
            $this->postalCodes[$elementIdx] = null;
        }

        return $this->postalCodes[$elementIdx];
    }
public function getPostalCodes($elementIdx = 0)
    {
        if (true === array_key_exists($elementIdx, $this->postalCodes)) {
            return $this->postalCodes[$elementIdx];
        }

        if (false === array_key_exists($elementIdx, $this->response['elements'])) {
            throw new \Exception('Oups...');
        }

        if (true === array_key_exists('addr:postcode', $this->response['elements'][$elementIdx]['tags'])) {
            $postcode = $this->response['elements'][$elementIdx]['tags']['addr:postcode'];
            $this->postalCodes[$elementIdx] = explode(';', $postcode);

            // Ok... let's free a little bit of memory
            unset($this->response['elements'][$elementIdx]['tags']['addr:postcode']);
        } else {
            $this->postalCodes[$elementIdx] = null;
        }

        return $this->postalCodes[$elementIdx];
    }
public function getPostalCodes ( $ elementIdx = 0 ) { if ( true === array_key_exists ( $ elementIdx , $ this -> postalCodes ) ) { return $ this -> postalCodes [ $ elementIdx ] ; } if ( false === array_key_exists ( $ elementIdx , $ this -> response [ 'elements' ] ) ) { throw new \ Exception ( 'Oups...' ) ; } if ( true === array_key_exists ( 'addr:postcode' , $ this -> response [ 'elements' ] [ $ elementIdx ] [ 'tags' ] ) ) { $ postcode = $ this -> response [ 'elements' ] [ $ elementIdx ] [ 'tags' ] [ 'addr:postcode' ] ; $ this -> postalCodes [ $ elementIdx ] = explode ( ';' , $ postcode ) ; // Ok... let's free a little bit of memory unset ( $ this -> response [ 'elements' ] [ $ elementIdx ] [ 'tags' ] [ 'addr:postcode' ] ) ; } else { $ this -> postalCodes [ $ elementIdx ] = null ; } return $ this -> postalCodes [ $ elementIdx ] ; }
Returns the list of postal codes for a given element of the response

@param integer $elementIdx Index of the element in the response

@throws Exception

@return string[] Array of postal code
Returns the list of postal codes for a given element of the response