# \cge_address

A simple class for defining and manipulating an address.

## Summary

Methods
Properties
Constants
set_company()
get_company()
set_firstname()
get_firstname()
set_lastname()
get_lastname()
set_address1()
get_address1()
set_address2()
get_address2()
set_city()
get_city()
set_state()
get_state()
set_postal()
get_postal()
set_country()
get_country()
set_phone()
get_phone()
set_fax()
get_fax()
set_email()
get_email()
is_valid()
from_array()
to_array()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  lib/class.cge_address.php
Package
  \CGExtensions
Class hierarchy
  \cge_address

## Tags

todo |

## Methods

### set_company()

    set_company(string $str)

Set the company name for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_company()

    get_company() : string

Return the company name (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_firstname()

    set_firstname(string $str)

Set the first name for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_firstname()

    get_firstname() : string

Return the first name (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_lastname()

    set_lastname(string $str)

Set the last name for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_lastname()

    get_lastname() : string

Return the last name (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_address1()

    set_address1(string $str)

Set the first address line for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_address1()

    get_address1() : string

Return the first address line (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_address2()

    set_address2(string $str)

Set the second address line for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_address2()

    get_address2() : string

Return the second address line (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_city()

    set_city(string $str)

Set the city for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_city()

    get_city() : string

Return the city (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_state()

    set_state(string $str)

Set the state for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_state()

    get_state() : string

Return the state (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_postal()

    set_postal(string $str)

Set the postal/zip code for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_postal()

    get_postal() : string

Return the postal/zip code (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_country()

    set_country(string $str)

Set the country for this address.

it is recommended to use the short country code (i.e: US or CA) for most addresses.

#### Parameters

string | $str |

#

## Tags

todo |

### get_country()

    get_country() : string

Return the country (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_phone()

    set_phone(string $str)

Set a phone number for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_phone()

    get_phone() : string

Return the phone number (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_fax()

    set_fax(string $str)

Set a fax number for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_fax()

    get_fax() : string

Return the fax number (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### set_email()

    set_email(string $str)

Set an email address for this address.

#### Parameters

string | $str |

#

## Tags

todo |

### get_email()

    get_email() : string

Return the email address (if any) associated with this address.

#### Returns

string

#

## Tags

todo |

### is_valid()

    is_valid() : bool

Test if the address is valid or not.

#### Returns

bool

#

## Tags

todo |

### from_array()

    from_array(array $params, string $prefix)

Fill the contents of the current object with the data from an array.

Expects an associative array with the following fields: company,firstname,lastname,address1,address2,city,state,postal,country,phone,fax,email.

#### Parameters

array | $params | The input array
string | $prefix | An optional prefix for the array keys.

#

## Tags

todo |

### to_array()

    to_array(string $prefix) : array

Create an associative array with the details oft he address.

#### Parameters

string | $prefix | An optional prefix for each of the array keys.

#### Returns

array

#

## Tags

todo |

### class.cge_address.php