class PoMemoryWriter implements PoWriterInterface (View source)

Defines a Gettext PO memory writer, to be used by the installer.

Properties

protected array $items

Array to hold all PoItem elements.

Methods

__construct()

Constructor, initialize empty items.

writeItem(PoItem $item)

Writes the given item.

writeItems(PoReaderInterface $reader, $count = -1)

Writes all or the given amount of items.

array
getData()

Get all stored PoItem's.

setLangcode(string $langcode)

Implements Drupal\Component\Gettext\PoMetadataInterface:setLangcode().

string
getLangcode()

Implements Drupal\Component\Gettext\PoMetadataInterface:getLangcode().

getHeader()

Implements Drupal\Component\Gettext\PoMetadataInterface:getHeader().

setHeader(PoHeader $header)

Implements Drupal\Component\Gettext\PoMetadataInterface:setHeader().

Details

__construct()

Constructor, initialize empty items.

writeItem(PoItem $item)

Writes the given item.

Parameters

PoItem $item

One specific item to write.

writeItems(PoReaderInterface $reader, $count = -1)

Writes all or the given amount of items.

Parameters

PoReaderInterface $reader

Reader to read PoItems from.

$count

Amount of items to read from $reader to write. If -1, all items are read from $reader.

array getData()

Get all stored PoItem's.

Return Value

array PoItem

setLangcode(string $langcode)

Implements Drupal\Component\Gettext\PoMetadataInterface:setLangcode().

Not implemented. Not relevant for the MemoryWriter.

Parameters

string $langcode

Language code string.

string getLangcode()

Implements Drupal\Component\Gettext\PoMetadataInterface:getLangcode().

Not implemented. Not relevant for the MemoryWriter.

Return Value

string

Language code string.

PoHeader getHeader()

Implements Drupal\Component\Gettext\PoMetadataInterface:getHeader().

Not implemented. Not relevant for the MemoryWriter.

Return Value

PoHeader

Header instance representing metadata in a PO header.

setHeader(PoHeader $header)

Implements Drupal\Component\Gettext\PoMetadataInterface:setHeader().

Not implemented. Not relevant for the MemoryWriter.

Parameters

PoHeader $header

Header object representing metadata in a PO header.