-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmessage.php
More file actions
30 lines (25 loc) · 781 Bytes
/
Copy pathmessage.php
File metadata and controls
30 lines (25 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* Class that parses some extra information from
* the JMS message. May not be necessary.
*
* @author Richard Wincewicz
*/
class Message {
function __construct($message = NULL) {
if ($message == NULL) {
return;
}
$this->xml = new DOMDocument();
$this->xml->loadXML($message);
$this->author = (string) $this->xml->getElementsByTagName('name')->item(0)->nodeValue;
$this->category = $this->xml->getElementsByTagName('category');
foreach ($this->category as $category) {
$scheme = explode(':', $category->getAttribute('scheme'));
$term = $category->getAttribute('term');
$this->{$scheme[1]} = $term;
}
$this->title = (string) $this->xml->getElementsByTagName('title')->item(0)->nodeValue;
}
}
?>