class ElementReadyEvent extends GenericEvent (View source)

Properties

protected SitemapElement|null $element

The sitemap element (may be set to null by an event listener).

Methods

__construct(SitemapElement $element)

Initialize the instance.

getSubject()

{@inheritdoc}

getElement()

Get the sitemap element (may be set to null by an event listener).

$this
setElement(SitemapElement $newElement = null)

Replace the sitemap element (use NULL to skip a page).

Details

__construct(SitemapElement $element)

Initialize the instance.

Parameters

SitemapElement $element

getSubject()

{@inheritdoc}

See also

\Symfony\Component\EventDispatcher\GenericEvent::getSubject()

SitemapElement|null getElement()

Get the sitemap element (may be set to null by an event listener).

Return Value

SitemapElement|null

$this setElement(SitemapElement $newElement = null)

Replace the sitemap element (use NULL to skip a page).

Parameters

SitemapElement $newElement

Return Value

$this

Exceptions

InvalidArgumentException

throws an InvalidArgumentException exception if you are setting to NULL the sitemap header or footer (just sitemap pages can be set to NULL)