/**
  * @return \HelpScout\model\ref\CustomerRef
  */
 public function toRef()
 {
     $ref = new \HelpScout\model\ref\CustomerRef();
     $ref->setId($this->id);
     $ref->setFirstName($this->firstName);
     $ref->setLastName($this->lastName);
     return $ref;
 }
             $attachment->setMimeType('image/png');
         }
         if (endswith($url, '.jpg') || endswith($url, '.jpeg')) {
             $attachment->setMimeType('image/jpeg');
         }
         $attachment->setFileName(filename_from_url($url));
         $attachment->setData(file_get_contents($url));
         $client->createAttachment($attachment);
         $attachments[] = $attachment;
     }
 }
 // Create the customer
 $customer = new \HelpScout\model\ref\CustomerRef();
 $customer->setId(null);
 $customer->setEmail($row['email']);
 $customer->setFirstName($row['f_name']);
 $customer->setLastName($row['l_name']);
 // Create the conversation
 $conversation = new \HelpScout\model\Conversation();
 $conversation->setSubject($row['reason'] . ': ' . $row['subject']);
 $conversation->setCreatedAt(format_api_date($row['date']));
 $conversation->setMailbox($mailbox);
 $conversation->setCustomer($customer);
 $conversation->setType('email');
 $tags = array('backlog', strtolower($row['reason']));
 if ($row['extension'] == 'Yes') {
     $tags[] = strtolower($row['extension_name']);
 }
 $conversation->setTags($tags);
 // A conversation must have at least one thread
 $thread = new \HelpScout\model\thread\Customer();