public function get($condition)
    {
        if (!is_array($condition)) {
            $condition = array('address_id' => $condition);
        }

        $result = &gplcart_static(gplcart_array_hash(array('address.get' => $condition)));

        if (isset($result)) {
            return $result;
        }

        $result = null;
        $this->hook->attach('address.get.before', $condition, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $condition['prepare'] = false;
        $condition['limit'] = array(0, 1);

        $list = (array) $this->getList($condition);
        $result = empty($list) ? array() : reset($list);

        if (isset($result['country_format'])) {
            $result['country_format'] += $this->country->getDefaultFormat();
        }

        $this->hook->attach('address.get.after', $condition, $result, $this);
        return (array) $result;
    }
public function get($condition)
    {
        if (!is_array($condition)) {
            $condition = array('address_id' => $condition);
        }

        $result = &gplcart_static(gplcart_array_hash(array('address.get' => $condition)));

        if (isset($result)) {
            return $result;
        }

        $result = null;
        $this->hook->attach('address.get.before', $condition, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $condition['prepare'] = false;
        $condition['limit'] = array(0, 1);

        $list = (array) $this->getList($condition);
        $result = empty($list) ? array() : reset($list);

        if (isset($result['country_format'])) {
            $result['country_format'] += $this->country->getDefaultFormat();
        }

        $this->hook->attach('address.get.after', $condition, $result, $this);
        return (array) $result;
    }
public function get ( $ condition ) { if ( ! is_array ( $ condition ) ) { $ condition = array ( 'address_id' => $ condition ) ; } $ result = & gplcart_static ( gplcart_array_hash ( array ( 'address.get' => $ condition ) ) ) ; if ( isset ( $ result ) ) { return $ result ; } $ result = null ; $ this -> hook -> attach ( 'address.get.before' , $ condition , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( array ) $ result ; } $ condition [ 'prepare' ] = false ; $ condition [ 'limit' ] = array ( 0 , 1 ) ; $ list = ( array ) $ this -> getList ( $ condition ) ; $ result = empty ( $ list ) ? array ( ) : reset ( $ list ) ; if ( isset ( $ result [ 'country_format' ] ) ) { $ result [ 'country_format' ] += $ this -> country -> getDefaultFormat ( ) ; } $ this -> hook -> attach ( 'address.get.after' , $ condition , $ result , $ this ) ; return ( array ) $ result ; }
Loads an address from the database
@param int|array|string $condition
@return array
Loads an address from the database