public function PoMemoryWriter::writeItems

public PoMemoryWriter::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.

Overrides PoWriterInterface::writeItems

File

core/lib/Drupal/Component/Gettext/PoMemoryWriter.php, line 39

Class

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

Namespace

Drupal\Component\Gettext

Code

public function writeItems(PoReaderInterface $reader, $count = -1) {
  $forever = $count == -1;
  while (($count-- > 0 || $forever) && ($item = $reader->readItem())) {
    $this->writeItem($item);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Gettext!PoMemoryWriter.php/function/PoMemoryWriter::writeItems/8.1.x