PHP Class Sonata\Exporter\Writer\SitemapWriter

Inheritance: implements Sonata\Exporter\Writer\WriterInterface
Afficher le fichier Open project: sonata-project/exporter Class Usage Examples

Protected Properties

Свойство Type Description
$autoIndex boolean
$buffer resource
$bufferPart integer
$bufferSize integer
$bufferUrlCount integer
$folder string
$groupName string
$headers array
$pattern string

Méthodes publiques

Méthode Description
__construct ( string $folder, mixed $groupName = false, array $headers = [], boolean $autoIndex = true ) Constructor.
close ( )
generateSitemapIndex ( string $folder, string $baseUrl, string $pattern = 'sitemap*.xml', string $filename = 'sitemap.xml' ) Generates the sitemap index from the sitemap part avaible in the folder.
getFolder ( ) : string Returns folder to store the sitemap.xml file.
isAutoIndex ( ) : boolean Returns the status of auto generation of index site map.
open ( )
write ( array $data )

Méthodes protégées

Méthode Description
addSitemapLine ( string $line ) Add a new line into the sitemap part.
buildData ( array $data ) : array Build data with default parameters.
closeSitemap ( ) Close the sitemap part.
fixDataType ( array &$data ) Fix type of data, if data type is specific, he must to be defined in data and he must to be a array.
generateDefaultLine ( array $data ) : string Generate standard line of sitemap.
generateImageLine ( array $data ) : string Generate image line of sitemap.
generateNewPart ( ) Generate a new sitemap part.
generateVideoLine ( array $data ) : string Generate video line of sitemap.
getHeaderByFlag ( ) : string Generate additional header with namespace adapted to the content.

Method Details

__construct() public méthode

Constructor.
public __construct ( string $folder, mixed $groupName = false, array $headers = [], boolean $autoIndex = true )
$folder string The folder to store the sitemap.xml file
$groupName mixed Name of sub-sitemap (optional)
$headers array Indicate the need for namespace in the header sitemap
$autoIndex boolean If you want to generate index of sitemap (optional)

addSitemapLine() protected méthode

Add a new line into the sitemap part.
protected addSitemapLine ( string $line )
$line string

buildData() protected méthode

Build data with default parameters.
protected buildData ( array $data ) : array
$data array List of parameters
Résultat array

close() public méthode

public close ( )

closeSitemap() protected méthode

Close the sitemap part.
protected closeSitemap ( )

fixDataType() protected méthode

Fix type of data, if data type is specific, he must to be defined in data and he must to be a array.
protected fixDataType ( array &$data )
$data array

generateDefaultLine() protected méthode

Generate standard line of sitemap.
protected generateDefaultLine ( array $data ) : string
$data array List of parameters
Résultat string

generateImageLine() protected méthode

Generate image line of sitemap.
protected generateImageLine ( array $data ) : string
$data array List of parameters
Résultat string

generateNewPart() protected méthode

Generate a new sitemap part.
protected generateNewPart ( )

generateSitemapIndex() public static méthode

Generates the sitemap index from the sitemap part avaible in the folder.
public static generateSitemapIndex ( string $folder, string $baseUrl, string $pattern = 'sitemap*.xml', string $filename = 'sitemap.xml' )
$folder string A folder to write sitemap index
$baseUrl string A base URL
$pattern string A sitemap pattern, optional
$filename string A sitemap file name, optional

generateVideoLine() protected méthode

Generate video line of sitemap.
protected generateVideoLine ( array $data ) : string
$data array List of parameters
Résultat string

getFolder() public méthode

Returns folder to store the sitemap.xml file.
public getFolder ( ) : string
Résultat string

getHeaderByFlag() protected méthode

Generate additional header with namespace adapted to the content.
protected getHeaderByFlag ( ) : string
Résultat string

isAutoIndex() public méthode

Returns the status of auto generation of index site map.
public isAutoIndex ( ) : boolean
Résultat boolean

open() public méthode

public open ( )

write() public méthode

public write ( array $data )
$data array

Property Details

$autoIndex protected_oe property

protected bool $autoIndex
Résultat boolean

$buffer protected_oe property

protected resource $buffer
Résultat resource

$bufferPart protected_oe property

protected int $bufferPart
Résultat integer

$bufferSize protected_oe property

protected int $bufferSize
Résultat integer

$bufferUrlCount protected_oe property

protected int $bufferUrlCount
Résultat integer

$folder protected_oe property

protected string $folder
Résultat string

$groupName protected_oe property

protected string $groupName
Résultat string

$headers protected_oe property

protected array $headers
Résultat array

$pattern protected_oe property

protected string $pattern
Résultat string