You are here

class ChainExtractor in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Extractor/ChainExtractor.php \Symfony\Component\Translation\Extractor\ChainExtractor

ChainExtractor extracts translation messages from template files.

@author Michel Salib <michelsalib@hotmail.com>

Hierarchy

Expanded class hierarchy of ChainExtractor

File

vendor/symfony/translation/Extractor/ChainExtractor.php, line 21

Namespace

Symfony\Component\Translation\Extractor
View source
class ChainExtractor implements ExtractorInterface {

  /**
   * The extractors.
   *
   * @var ExtractorInterface[]
   */
  private $extractors = array();

  /**
   * Adds a loader to the translation extractor.
   *
   * @param string             $format    The format of the loader
   * @param ExtractorInterface $extractor The loader
   */
  public function addExtractor($format, ExtractorInterface $extractor) {
    $this->extractors[$format] = $extractor;
  }

  /**
   * {@inheritdoc}
   */
  public function setPrefix($prefix) {
    foreach ($this->extractors as $extractor) {
      $extractor
        ->setPrefix($prefix);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function extract($directory, MessageCatalogue $catalogue) {
    foreach ($this->extractors as $extractor) {
      $extractor
        ->extract($directory, $catalogue);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ChainExtractor::$extractors private property The extractors.
ChainExtractor::addExtractor public function Adds a loader to the translation extractor.
ChainExtractor::extract public function Extracts translation messages from files, a file or a directory to the catalogue. Overrides ExtractorInterface::extract
ChainExtractor::setPrefix public function Sets the prefix that should be used for new found messages. Overrides ExtractorInterface::setPrefix