PrefixLines::setPrefix PHP Method

setPrefix() public method

Sets the prefix to add at the start of each input line.
public setPrefix ( string $prefix )
$prefix string The prefix to add at the start of each input line. May be null, in which case no prefix is added.
    function setPrefix($prefix)
    {
        $this->_prefix = (string) $prefix;
    }

Usage Example

Beispiel #1
0
 /**
  * Creates a new PrefixLines filter using the passed in
  * Reader for instantiation.
  *
  * @param Reader $reader
  * @internal param A $object Reader object providing the underlying stream.
  *               Must not be <code>null</code>.
  *
  * @return object A new filter based on this configuration, but filtering
  *                the specified reader
  */
 public function chain(Reader $reader)
 {
     $newFilter = new PrefixLines($reader);
     $newFilter->setPrefix($this->getPrefix());
     $newFilter->setInitialized(true);
     $newFilter->setProject($this->getProject());
     return $newFilter;
 }