Drupal 8  8.0.2
PoDatabaseWriter Class Reference
Inheritance diagram for PoDatabaseWriter:

Public Member Functions

 __construct ()
 
 getLangcode ()
 
 setLangcode ($langcode)
 
 getReport ()
 
 setReport ($report=array())
 
 getOptions ()
 
 setOptions (array $options)
 
 getHeader ()
 
 setHeader (PoHeader $header)
 
 writeItem (PoItem $item)
 
 writeItems (PoReaderInterface $reader, $count=-1)
 

Detailed Description

Gettext PO writer working with the locale module database.

Constructor & Destructor Documentation

__construct ( )

Constructor, initialize reporting array.

References PoDatabaseWriter\setReport().

Here is the call graph for this function:

Member Function Documentation

getHeader ( )

{Get header metadata.

Returns
$header Header instance representing metadata in a PO header.
}

Implements PoMetadataInterface.

getLangcode ( )

{Get language code.

Returns
string Language code string.
}

Implements PoMetadataInterface.

getOptions ( )

Get the options used by the writer.

Referenced by PoDatabaseWriter\setHeader().

Here is the caller graph for this function:

getReport ( )

Get the report of the write operations.

setHeader ( PoHeader  $header)

Implements Drupal::setHeader().

Sets the header and configure Drupal accordingly.

Before being able to process the given header we need to know in what context this database write is done. For this the options must be set.

A langcode is required to set the current header's PluralForm.

Parameters
\Drupal\Component\Gettext\PoHeader$headerHeader metadata.
Exceptions
Exception

Implements PoMetadataInterface.

References PoDatabaseWriter\getOptions(), PoHeader\getPluralForms(), PoHeader\parsePluralForms(), Drupal\service(), and Drupal\state().

Here is the call graph for this function:

setLangcode (   $langcode)

{Set language code.

Parameters
string$langcodeLanguage code string.
}

Implements PoMetadataInterface.

setOptions ( array  $options)

Set the options for the current writer.

setReport (   $report = array())

Set the report array of write operations.

Parameters
array$reportAssociative array with result information.

Referenced by PoDatabaseWriter\__construct().

Here is the caller graph for this function:

writeItem ( PoItem  $item)

{Writes the given item.

Parameters
PoItem$itemOne specific item to write.
}

Implements PoWriterInterface.

References PoItem\getSource(), PoItem\getTranslation(), PoItem\isPlural(), PoItem\setSource(), and PoItem\setTranslation().

Referenced by PoDatabaseWriter\writeItems().

Here is the call graph for this function:

Here is the caller graph for this function:

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

{Writes all or the given amount of items.

Parameters
PoReaderInterface$readerReader to read PoItems from.
$countAmount of items to read from $reader to write. If -1, all items are read from $reader.
}

Implements PoWriterInterface.

References PoReaderInterface\readItem(), and PoDatabaseWriter\writeItem().

Here is the call graph for this function:


The documentation for this class was generated from the following file: