PHP Класс Sonata\Exporter\Writer\SitemapWriter

Наследование: implements Sonata\Exporter\Writer\WriterInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$autoIndex boolean
$buffer resource
$bufferPart integer
$bufferSize integer
$bufferUrlCount integer
$folder string
$groupName string
$headers array
$pattern string

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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() защищенный Метод

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

buildData() защищенный Метод

Build data with default parameters.
protected buildData ( array $data ) : array
$data array List of parameters
Результат array

close() публичный Метод

public close ( )

closeSitemap() защищенный Метод

Close the sitemap part.
protected closeSitemap ( )

fixDataType() защищенный Метод

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() защищенный Метод

Generate standard line of sitemap.
protected generateDefaultLine ( array $data ) : string
$data array List of parameters
Результат string

generateImageLine() защищенный Метод

Generate image line of sitemap.
protected generateImageLine ( array $data ) : string
$data array List of parameters
Результат string

generateNewPart() защищенный Метод

Generate a new sitemap part.
protected generateNewPart ( )

generateSitemapIndex() публичный статический Метод

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() защищенный Метод

Generate video line of sitemap.
protected generateVideoLine ( array $data ) : string
$data array List of parameters
Результат string

getFolder() публичный Метод

Returns folder to store the sitemap.xml file.
public getFolder ( ) : string
Результат string

getHeaderByFlag() защищенный Метод

Generate additional header with namespace adapted to the content.
protected getHeaderByFlag ( ) : string
Результат string

isAutoIndex() публичный Метод

Returns the status of auto generation of index site map.
public isAutoIndex ( ) : boolean
Результат boolean

open() публичный Метод

public open ( )

write() публичный Метод

public write ( array $data )
$data array

Описание свойств

$autoIndex защищенное свойство

protected bool $autoIndex
Результат boolean

$buffer защищенное свойство

protected resource $buffer
Результат resource

$bufferPart защищенное свойство

protected int $bufferPart
Результат integer

$bufferSize защищенное свойство

protected int $bufferSize
Результат integer

$bufferUrlCount защищенное свойство

protected int $bufferUrlCount
Результат integer

$folder защищенное свойство

protected string $folder
Результат string

$groupName защищенное свойство

protected string $groupName
Результат string

$headers защищенное свойство

protected array $headers
Результат array

$pattern защищенное свойство

protected string $pattern
Результат string