summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_message_header.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-12-11 08:31:07 +0100
committerAleksander Machniak <alec@alec.pl>2012-12-11 08:31:07 +0100
commit25bf00ecbc2cab20ce66845513980b83b03f7c49 (patch)
treebc5bda79cbafd35ed1c2d5e4461d43dca8324f49 /program/lib/Roundcube/rcube_message_header.php
parentd9f109b56af2015eae7aadc5e87c06365854eda0 (diff)
parent31521613e40bb57f430591bab30de2c202637db2 (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/lib/Roundcube/rcube_message_header.php')
-rw-r--r--program/lib/Roundcube/rcube_message_header.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_message_header.php b/program/lib/Roundcube/rcube_message_header.php
index 445d0bd39..7009a00af 100644
--- a/program/lib/Roundcube/rcube_message_header.php
+++ b/program/lib/Roundcube/rcube_message_header.php
@@ -235,6 +235,22 @@ class rcube_message_header
$this->others[$name] = $value;
}
}
+
+
+ /**
+ * Factory method to instantiate headers from a data array
+ *
+ * @param array Hash array with header values
+ * @return object rcube_message_header instance filled with headers values
+ */
+ public static function from_array($arr)
+ {
+ $obj = new rcube_message_header;
+ foreach ($arr as $k => $v)
+ $obj->set($k, $v);
+
+ return $obj;
+ }
}