/**
  * Attach a file to a record in MinistryPlatform.
  * 
  * @param  File $file
  * @return array
  */
 public function attachFile(File $file)
 {
     $parameters = array('GUID' => $this->guid, 'Password' => $this->pw, 'FileContents' => $file->getBinary(), 'FileName' => $file->getName(), 'PageID' => $file->getPageId(), 'RecordID' => $file->getRecordId(), 'FileDescription' => $file->getDescription(), 'IsImage' => $file->getIsImage(), 'ResizeLongestDimension' => $file->getPixels());
     $function = 'AttachFile';
     $response = $this->SplitToArray($this->execute($function, $parameters)->AttachFileResult);
     if ($response[0] == "0") {
         throw new MinistryPlatformException($response[2], (int) $response[1]);
     }
     return $response;
 }