-
Notifications
You must be signed in to change notification settings - Fork 452
/
XmlReadyEvent.php
60 lines (52 loc) · 1.14 KB
/
XmlReadyEvent.php
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
<?php
namespace Concrete\Core\Page\Sitemap\Event;
use SimpleXMLElement;
use Symfony\Component\EventDispatcher\GenericEvent;
class XmlReadyEvent extends GenericEvent
{
/**
* The sitemap XML document.
*
* @var \SimpleXMLElement
*/
protected $document;
/**
* Initialize the instance.
*
* @param \SimpleXMLElement $document the sitemap XML document
*/
public function __construct(SimpleXMLElement $document)
{
$this->document = $document;
}
/**
* {@inheritdoc}
*
* @see \Symfony\Component\EventDispatcher\GenericEvent::getSubject()
*/
public function getSubject()
{
return ['xmlDoc' => $this->document];
}
/**
* Get the sitemap XML document.
*
* @return \SimpleXMLElement
*/
public function getDocument()
{
return $this->element;
}
/**
* Replace the sitemap XML document.
*
* @param \SimpleXMLElement $newDocument
*
* @return $this
*/
public function setDocument(SimpleXMLElement $newDocument)
{
$this->document = $newDocument;
return $this;
}
}