PHP Class PrefixLines, symfony-1.4

Example:
Or:

 
See also: FilterReader
Author: hans lellelid, [email protected]
Inheritance: extends BaseParamFilterReader, implements ChainableReader
Mostra file Open project: vjousse/symfony-1.4 Class Usage Examples

Public Methods

Method Description
chain ( Reader $reader ) : object Creates a new PrefixLines filter using the passed in Reader for instantiation.
getPrefix ( ) : string Returns the prefix which will be added at the start of each input line.
read ( $len = null ) : mixed Adds a prefix to each line of input stream and returns resulting stream.
setPrefix ( string $prefix ) Sets the prefix to add at the start of each input line.

Private Methods

Method Description
_initialize ( ) Initializes the prefix if it is available from the parameters.

Method Details

chain() public method

Creates a new PrefixLines filter using the passed in Reader for instantiation.
public chain ( Reader $reader ) : object
$reader Reader
return object A new filter based on this configuration, but filtering the specified reader

getPrefix() public method

Returns the prefix which will be added at the start of each input line.
public getPrefix ( ) : string
return string The prefix which will be added at the start of each input line

read() public method

Adds a prefix to each line of input stream and returns resulting stream.
public read ( $len = null ) : mixed
return mixed buffer, -1 on EOF

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.