/**
  * Return
  *
  * @access public
  * @param $typeId
  * @param $main
  * @return string with formated address.
  */
 function getStringAddress($type)
 {
     $address_type_id = AddressTypes::getAddressTypeId($type);
     $address = ContactAddresses::findOne(array('conditions' => array("`contact_id` = ? AND `address_type_id` = ?", $this->getId(), $address_type_id)));
     if (!$address instanceof ContactAddress) {
         return "";
     }
     $out = $address->getStreet();
     if ($address->getCity() != '') {
         $out .= ' - ' . $address->getCity();
     }
     if ($address->getState() != '') {
         $out .= ' - ' . $address->getState();
     }
     if ($address->getCountry() != '') {
         $out .= ' - ' . $address->getCountryName();
     }
     return $out;
 }
Beispiel #2
0
	/**
	 * Return  
	 *
	 * @access public
	 * @param $typeId
	 * @param $main
	 * @return string with formated address.
	 */
	function getStringAddress($type) {
		$address_type_id = AddressTypes::getAddressTypeId($type);
		$address = ContactAddresses::findOne(array('conditions' => array("`contact_id` = ? AND `address_type_id` = ?", 
    		   $this->getId(), $address_type_id)));
        //print_r($address);
        $out = $address->getStreet();
        if($address->getCity() != '')
            $out .= ' - ' . $address->getCity();
        if($address->getState() != '')
            $out .= ' - ' . $address->getState();        
        if($address->getCountry() != '')
            $out .= ' - ' . $address->getCountryName();
        return $out;
        
	} // getMainPhone