/**
  * Copies the selected attachments.
  * 
  * @param	array		$messageMapping
  * @return	array		$attachmentMapping
  */
 public function copyAll(&$messageMapping)
 {
     $attachmentMapping = array();
     foreach ($this->attachments as $oldContainerID => $attachments) {
         foreach ($attachments as $attachment) {
             $newAttachment = AttachmentEditor::create(array('attachmentName' => $attachment->attachmentName, 'packageID' => $this->packageID, 'containerID' => $messageMapping[$oldContainerID], 'containerType' => $this->containerType, 'userID' => $attachment->userID, 'attachmentSize' => $attachment->attachmentSize, 'isImage' => $attachment->isImage, 'thumbnailType' => $attachment->thumbnailType, 'thumbnailSize' => $attachment->thumbnailSize, 'downloads' => $attachment->downloads, 'sha1Hash' => $attachment->sha1Hash, 'uploadTime' => $attachment->uploadTime, 'fileType' => $attachment->fileType, 'isBinary' => $attachment->isBinary, 'lastDownloadTime' => $attachment->lastDownloadTime, 'embedded' => $attachment->embedded, 'width' => $attachment->width, 'height' => $attachment->height));
             if (!isset($attachmentMapping[$messageMapping[$oldContainerID]])) {
                 $attachmentMapping[$messageMapping[$oldContainerID]] = array();
             }
             $attachmentMapping[$messageMapping[$oldContainerID]][$attachment->attachmentID] = $newAttachment->attachmentID;
             @copy(WCF_DIR . 'attachments/attachment-' . $attachment->attachmentID, WCF_DIR . 'attachments/attachment-' . $newAttachment->attachmentID);
             if (!empty($attachment->thumbnailType)) {
                 @copy(WCF_DIR . 'attachments/thumbnail-' . $attachment->attachmentID, WCF_DIR . 'attachments/thumbnail-' . $newAttachment->attachmentID);
             }
         }
     }
     return $attachmentMapping;
 }