Adds a transformer active for a passed key and prefix.
If you don't specify a key (and/or a prefix), it is active for all fetches.

@param TransformerInterface $transformer
@param string $key
@param string|NULL $prefix
511898
public function addTransformer(TransformerInterface $transformer, string $key = "", string $prefix = NULL) {
        if(!in_array($transformer, $this->transformers)) {
            $id = $prefix ? "$prefix.$key" : $key;
            $this->transformers[$id][] = $transformer;
        }
    }
647730
final public function addTransformer(Transformer $transformer)
    {
        if ($this->hasTransformer($transformer)) {
            throw new DuplicateTransformerException('Transformer already added.');
        }

        $this->transformers[spl_object_hash($transformer)] = $transformer;

        return $this;
    }
68124
public void endPrefixMapping(String prefix) throws SAXException
  {

    if (DEBUG)
      System.out.println("TransformerHandlerImpl#endPrefixMapping: "
                         + prefix);

    if (m_contentHandler != null)
    {
      m_contentHandler.endPrefixMapping(prefix);
    }
  }
553691
def add_transformer(self, transformer):
        
        if transformer not in self.transformers() and isinstance(transformer, TransformerDing0):
            self._transformers.append(transformer)
681864
public function setPrefix($prefix, $field = null)
    {
        $param = $this->buildParam('facet.prefix', $field);
        return $this->set($param, $prefix);
    }
201145
public function bind($key, $binder)
    {
        $this->binders[str_replace('-', '_', $key)] = RouteBinding::forCallback(
            $this->container, $binder
        );
    }
39502
public function item($data, $transformer = null, $resourceKey = null)
    {
        if (!$transformer) {
            $transformer = $this->getTransformer();
        }

        return $this->getService()->item($data, $transformer, $resourceKey);
    }
543041
public function addTransformation($name, $transformation) {
        if ($transformation instanceof Transformation) {
            $this->handlers[$name] = $transformation;
        } else {
            $this->transformations[$name] = $transformation;
        }

        return $this;
    }
596204
public function addDictionary(string $prefix, DictionaryInterface $dictionary)
    {
        if (!$dictionary instanceof WritableDictionaryInterface) {
            throw new \InvalidArgumentException('Dictionaries in ' . __CLASS__ . ' must be writable.');
        }
        parent::addDictionary($prefix, $dictionary);

        return $this;
    }
357297
public function transformItem($resource, TransformerInterface $transformer)
    {
        $data = $transformer->execute($resource);

        $rootKey = $this->options['root_key'];
        if ($rootKey) {
            return [$rootKey => $data];
        }

        return $data;
    }
800896
public function prefix( $prefix )
    {
        // Detect the Regexp delimiter
        $patternDelim = $this->pattern[0];

        // Add the Regexp delimiter to the prefix
        $prefix = $patternDelim . $prefix . $patternDelim;
        parent::prefix( $prefix );
    }
1339930
public function setTransformer(\chilimatic\lib\interfaces\IFlyWeightTransformer $transformer)
    {
        $this->transformer = $transformer;

        return $this;
    }
391277
def add_transform(self, key, xslt):
        
        self._remove_converter(key)
        self._xsltLibrary[key] = xslt
        self._add_converter(key)
1017677
protected function loadDefaultTransformers(ContainerBuilder $container)
    {
        $definition = new Definition('Behat\Behat\Transformation\Transformer\RepositoryArgumentTransformer', array(
            new Reference(self::REPOSITORY_ID),
            new Reference(CallExtension::CALL_CENTER_ID),
            new Reference(DefinitionExtension::PATTERN_TRANSFORMER_ID),
            new Reference(TranslatorExtension::TRANSLATOR_ID)
        ));
        $definition->addTag(self::ARGUMENT_TRANSFORMER_TAG, array('priority' => 50));
        $container->setDefinition(self::ARGUMENT_TRANSFORMER_TAG . '.repository', $definition);
    }
608381
public function setPrefix($prefix)
    {
        $this->prefix = $prefix;
        $this->identifier = $this->prefix.$this->key;

        return $this;
    }
780556
public function collection($data, $transformer, $resourceKey = null, Cursor $cursor = null, $meta = [])
    {
        if (!is_object($transformer) && !is_callable($transformer)) {
            $transformer = $this->di->getShared($transformer);
        }

        $resource = new Collection($data, $transformer, $resourceKey);

        foreach ($meta as $metaKey => $metaValue) {
            $resource->setMetaValue($metaKey, $metaValue);
        }

        if (!is_null($cursor)) {
            $resource->setCursor($cursor);
        }

        $rootScope = $this->getManager()->createData($resource);

        return $rootScope->toArray();
    }
496307
public function setTransform(\Jdenticon\Rendering\Transform $transform) 
    {
        $this->transform = $transform === null ? 
            Transform::getEmpty() : $transform;
    }