How to Load Address by Entity_id (address_id) in Magento 1.7

attributesbilling-addressmagento-1.7shipping-address

I need to change all addresses (billing, shipping) street attribute. I have only entity_id (address_id) from customer_address_entity_text.
How can I do it?

Best Answer

$addressId = ...your id here...;
$address = Mage::getModel('customer/address')->load($addressId);
$street = 'your street here';
//or if you want to have 2 lines on the street
//$street = array('First line', 'Second line');

if($address->getId()) {
    $address->setStreet($street);
    $address->save();
}