PHP Class Calotype\SEO\Generators\SitemapGenerator

Show file Open project: calotype/seo

Protected Properties

Property Type Description
$closures array Closures used for lazy loading.
$entries array All the entries of the sitemap.
$frequencies array The allowed values for the change frequency.
$replacements array The attributes that should be replaced with their valid counterpart for readability.
$required array The required fields of a sitemap entry.

Public Methods

Method Description
add ( mixed $object ) Add a SitemapAware object to the sitemap.
addAll ( array | Traversabl\Traversable $objects ) Add multiple SitemapAware objects to the sitemap.
addRaw ( array $data ) Add a raw entry to the sitemap.
contains ( string $url ) : boolean Check if the sitemap contains an url.
generate ( ) : string Generate the xml for the sitemap.
prepareData ( array $data ) : array Prepare the data.
reset ( ) : void Clean all entries from the sitemap.

Protected Methods

Method Description
loadClosures ( ) : void Load the lazy loaded elements.
replaceAttribute ( string $attribute ) : string Replace an attribute with it's replacement if available.
replaceAttributes ( array $data ) : array Replace the attribute names with their replacements.
validateData ( array $data ) Validate the data for a sitemap entry.
validateObject ( mixed $element ) Validate an element.

Method Details

add() public method

Add a SitemapAware object to the sitemap.
public add ( mixed $object )
$object mixed

addAll() public method

Add multiple SitemapAware objects to the sitemap.
public addAll ( array | Traversabl\Traversable $objects )
$objects array | Traversabl\Traversable

addRaw() public method

Add a raw entry to the sitemap.
public addRaw ( array $data )
$data array

contains() public method

Check if the sitemap contains an url.
public contains ( string $url ) : boolean
$url string
return boolean

generate() public method

Generate the xml for the sitemap.
public generate ( ) : string
return string

loadClosures() protected method

Load the lazy loaded elements.
protected loadClosures ( ) : void
return void

prepareData() public method

Prepare the data.
public prepareData ( array $data ) : array
$data array
return array

replaceAttribute() protected method

Replace an attribute with it's replacement if available.
protected replaceAttribute ( string $attribute ) : string
$attribute string
return string

replaceAttributes() protected method

Replace the attribute names with their replacements.
protected replaceAttributes ( array $data ) : array
$data array
return array

reset() public method

Clean all entries from the sitemap.
public reset ( ) : void
return void

validateData() protected method

Validate the data for a sitemap entry.
protected validateData ( array $data )
$data array

validateObject() protected method

Validate an element.
protected validateObject ( mixed $element )
$element mixed

Property Details

$closures protected property

Closures used for lazy loading.
protected array $closures
return array

$entries protected property

All the entries of the sitemap.
protected array $entries
return array

$frequencies protected property

The allowed values for the change frequency.
protected array $frequencies
return array

$replacements protected property

The attributes that should be replaced with their valid counterpart for readability.
protected array $replacements
return array

$required protected property

The required fields of a sitemap entry.
protected array $required
return array