/**
  * Retrieves the specified customer record, encapsulates the details in a
  * Customer object and returns this.
  *
  * @param string $identifier
  * Identifies the customer record in the legacy customer table.
  *
  * @return Model_Core_Customer
  * The customer details encapsulated in a Customer object.#5 /home/benjamin.vickers/HomeLet-Framework/src/application/models/datasources/Core/LegacyCustomers.php(209): Zend_Db_Table_Abstract->fetchRow(Object(Zend_Db_Table_Select))
  *
  * @throws Zend_Exception
  * Throws a Zend_Exception if the customer record cannot be found.
  */
 public function getCustomer($identifier)
 {
     //Retrieve the customer record.
     $select = $this->select();
     $select->where('refno = ?', $identifier);
     $customerRow = $this->fetchRow($select);
     if (empty($customerRow)) {
         throw new Zend_Exception('Customer not found.');
     }
     //Populate the details into a Customer object.
     $customer = new Model_Core_Customer();
     $customer->setIdentifier(Model_Core_Customer::LEGACY_IDENTIFIER, $identifier);
     $customerMaps = new Datasource_Core_CustomerMaps();
     $customerMap = $customerMaps->getMap(Model_Core_Customer::LEGACY_IDENTIFIER, $identifier);
     if ($customerMap) {
         $customer->setIdentifier(Model_Core_Customer::IDENTIFIER, $customerMap->getIdentifier());
     }
     $customer->setTitle($customerRow->title);
     $customer->setFirstName($customerRow->firstname);
     $customer->setLastName($customerRow->lastname);
     $customer->setAddressLine(Model_Core_Customer::ADDRESSLINE1, $customerRow->personaladdress1);
     $customer->setAddressLine(Model_Core_Customer::ADDRESSLINE2, $customerRow->personaladdress3);
     $customer->setAddressLine(Model_Core_Customer::ADDRESSLINE3, $customerRow->personaladdress5);
     $customer->setPostCode($customerRow->personalpostcode);
     $customer->setCountry($customerRow->country);
     if ($customerRow->isForeignAddress == 'no') {
         $customer->setIsForeignAddress(false);
     } else {
         $customer->setIsForeignAddress(true);
     }
     $customer->setTelephone(Model_Core_Customer::TELEPHONE1, $customerRow->phone1);
     $customer->setTelephone(Model_Core_Customer::TELEPHONE2, $customerRow->phone2);
     $customer->setFax($customerRow->fax);
     $customer->setEmailAddress($customerRow->email);
     $customer->setPassword($customerRow->password);
     $customer->setOccupation($customerRow->occupation);
     $customer->setDateOfBirthAt($customerRow->date_of_birth_at);
     $customer->typeID = 2;
     // Default to a tenant
     return $customer;
 }