public function get($code)
    {
        $result = &gplcart_static("country.get.$code");

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

        $this->hook->attach('country.get.before', $code, $result, $this);

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

        $sql = 'SELECT * FROM country WHERE code=?';
        $result = $this->db->fetch($sql, array($code), array('unserialize' => 'format'));

        if (isset($result['format'])) {
            $default_format = $this->getDefaultFormat();
            $result['format'] = gplcart_array_merge($default_format, $result['format']);
            gplcart_array_sort($result['format']);
        }

        $this->hook->attach('country.get.after', $code, $result, $this);
        return $result;
    }
public function get($code)
    {
        $result = &gplcart_static("country.get.$code");

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

        $this->hook->attach('country.get.before', $code, $result, $this);

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

        $sql = 'SELECT * FROM country WHERE code=?';
        $result = $this->db->fetch($sql, array($code), array('unserialize' => 'format'));

        if (isset($result['format'])) {
            $default_format = $this->getDefaultFormat();
            $result['format'] = gplcart_array_merge($default_format, $result['format']);
            gplcart_array_sort($result['format']);
        }

        $this->hook->attach('country.get.after', $code, $result, $this);
        return $result;
    }
public function get ( $ code ) { $ result = & gplcart_static ( "country.get.$code" ) ; if ( isset ( $ result ) ) { return $ result ; } $ this -> hook -> attach ( 'country.get.before' , $ code , $ result , $ this ) ; if ( isset ( $ result ) ) { return $ result ; } $ sql = 'SELECT * FROM country WHERE code=?' ; $ result = $ this -> db -> fetch ( $ sql , array ( $ code ) , array ( 'unserialize' => 'format' ) ) ; if ( isset ( $ result [ 'format' ] ) ) { $ default_format = $ this -> getDefaultFormat ( ) ; $ result [ 'format' ] = gplcart_array_merge ( $ default_format , $ result [ 'format' ] ) ; gplcart_array_sort ( $ result [ 'format' ] ) ; } $ this -> hook -> attach ( 'country.get.after' , $ code , $ result , $ this ) ; return $ result ; }
Loads a country from the database
@param string $code
@return array
Loads a country from the database