Exemplo n.º 1
0
 /**
  * @param long $idAddress
  * @return AddressBookRecord
  */
 function &SelectAddressBookRecord($idAddress)
 {
     if (!$this->_dbConnection->Execute($this->_commandCreator->SelectAddressBookRecord($idAddress, $this->Account->IdUser))) {
         return null;
     }
     $addressBookRecord = null;
     $row = $this->_dbConnection->GetNextRecord();
     if ($row) {
         $addressBookRecord = new AddressBookRecord();
         $addressBookRecord->IdAddress = $row->id_addr;
         $addressBookRecord->StrId = $row->str_id;
         $addressBookRecord->IdUser = $row->id_user;
         $addressBookRecord->HomeEmail = $row->h_email;
         $addressBookRecord->FullName = $row->fullname;
         $addressBookRecord->Notes = $row->notes;
         $addressBookRecord->UseFriendlyName = (bool) abs($row->use_friendly_nm);
         $addressBookRecord->HomeStreet = $row->h_street;
         $addressBookRecord->HomeCity = $row->h_city;
         $addressBookRecord->HomeState = $row->h_state;
         $addressBookRecord->HomeZip = $row->h_zip;
         $addressBookRecord->HomeCountry = $row->h_country;
         $addressBookRecord->HomePhone = $row->h_phone;
         $addressBookRecord->HomeFax = $row->h_fax;
         $addressBookRecord->HomeMobile = $row->h_mobile;
         $addressBookRecord->HomeWeb = $row->h_web;
         $addressBookRecord->BusinessEmail = $row->b_email;
         $addressBookRecord->BusinessCompany = $row->b_company;
         $addressBookRecord->BusinessStreet = $row->b_street;
         $addressBookRecord->BusinessCity = $row->b_city;
         $addressBookRecord->BusinessState = $row->b_state;
         $addressBookRecord->BusinessZip = $row->b_zip;
         $addressBookRecord->BusinessCountry = $row->b_country;
         $addressBookRecord->BusinessJobTitle = $row->b_job_title;
         $addressBookRecord->BusinessDepartment = $row->b_department;
         $addressBookRecord->BusinessOffice = $row->b_office;
         $addressBookRecord->BusinessPhone = $row->b_phone;
         $addressBookRecord->BusinessFax = $row->b_fax;
         $addressBookRecord->BusinessWeb = $row->b_web;
         $addressBookRecord->OtherEmail = $row->other_email;
         $addressBookRecord->PrimaryEmail = (int) $row->primary_email;
         $addressBookRecord->IdPreviousAddress = (int) $row->id_addr_prev;
         $addressBookRecord->Temp = (bool) abs($row->tmp);
         $addressBookRecord->BirthdayDay = $row->birthday_day;
         $addressBookRecord->BirthdayMonth = $row->birthday_month;
         $addressBookRecord->BirthdayYear = $row->birthday_year;
     }
     return $addressBookRecord;
 }