-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatomentry.class
More file actions
61 lines (44 loc) · 1.54 KB
/
Copy pathatomentry.class
File metadata and controls
61 lines (44 loc) · 1.54 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
// must have a link if no content
class AtomEntry extends AtomElement {
public $Summary;
public $Content;
public $Published;
public function __construct() {
parent::__construct('entry');
$this->Content = NULL;
$this->Summary = NULL;
$this->Published = NULL;
}
public function AddContent($data, $type=AtomElement::TEXT_TYPE_TEXT) {
$this->Content = array('type' => $type, 'data' => $data);
}
public function AddSummary($data, $type=AtomElement::TEXT_TYPE_TEXT) {
$this->Summary = array('type' => $type, 'data' => $data);
}
// Time of the initial creation or first availability of the entry
public function SetPublished($published) {
if (!is_int($updated))
$this->Published = $published;
else
// XXX: UTC/Timezone checking, etc.
$this->Published = date(DATE_ATOM, $published);
}
// Copy of all child elements of feed sans entry elements if we copied this entry
public function SetSource() {
// XXX
}
public static function Consume($data) {
}
public function Build() {
if ($this->Content !== NULL)
$this->AddChild($this->CreateText('content', $this->Content));
if ($this->Summary !== NULL)
$this->AddChild($this->CreateText('summary', $this->Summary));
if ($this->Published !== NULL)
$this->AddChild($this->ForkChild('published', $this->Published));
parent::Build();
return $this;
}
}
?>