Exemplo n.º 1
0
 /**
  * Put the original values back in the message after it was modified before sending.
  * @param Swift_Message_Mime The message (or part)
  * @param array The location of the stored values
  */
 protected function recursiveRestore(Swift_Message_Mime $mime, &$store)
 {
     //Restore headers
     foreach ($store["headers"] as $name => $array) {
         if ($array["value"] !== false) {
             $mime->headers->set($name, $array["value"]);
         }
         foreach ($array["attributes"] as $att_name => $att_value) {
             $mime->headers->setAttribute($name, $att_name, $att_value);
         }
     }
     //Restore body
     if ($store["body"] !== false) {
         $mime->setData($store["body"]);
     }
     //Restore children
     foreach ($store["children"] as $id => $child_store) {
         $child = $mime->getChild($id);
         $this->recursiveRestore($child, $child_store);
     }
 }