PHP Class Plum\Plum\Workflow

Author: Florian Eckerstorfer ([email protected])
Afficher le fichier Open project: plumphp/plum Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( array $options = [] )
addConverter ( Plum\Plum\Converter\ConverterInterface | callable | array $element ) : Workflow
addFilter ( array | callable | Plum\Plum\Filter\FilterInterface $element ) : Workflow
addWriter ( Plum\Plum\Writer\WriterInterface | array $element ) : Workflow
getConverters ( ) : ConverterPipe[]
getFilters ( ) : FilterPipe[]
getPipeline ( string | null $type = null ) : AbstractPipe[]
getWriters ( ) : WriterPipe[]
process ( Plum\Plum\Reader\ReaderInterface[] | Plum\Plum\Reader\ReaderInterface $readers ) : Result

Méthodes protégées

Méthode Description
addPipe ( AbstractPipe $pipe ) : Workflow Inserts an element into the pipeline at the given position.
convertItem ( mixed $item, ConverterPipe $pipe ) : mixed Applies the given converter to the given item either if no filter is given or if the filter returns true.
convertItemValue ( mixed $item, ConverterPipe $pipe ) : mixed Applies the given converter to the given field in the given item if no filter is given or if the filters returns true for the field.
finishWriters ( WriterPipe[] $writers )
prepareWriters ( WriterPipe[] $writers )
processItem ( mixed $item, Result $result )
processReader ( Plum\Plum\Reader\ReaderInterface $reader, Result $result )
writeItem ( mixed $item, WriterPipe $pipe ) : boolean Writes the given item to the given writer if the no filter is given or the filter returns true.

Method Details

__construct() public méthode

public __construct ( array $options = [] )
$options array

addConverter() public méthode

public addConverter ( Plum\Plum\Converter\ConverterInterface | callable | array $element ) : Workflow
$element Plum\Plum\Converter\ConverterInterface | callable | array
Résultat Workflow $this

addFilter() public méthode

public addFilter ( array | callable | Plum\Plum\Filter\FilterInterface $element ) : Workflow
$element array | callable | Plum\Plum\Filter\FilterInterface
Résultat Workflow

addPipe() protected méthode

Inserts an element into the pipeline at the given position.
protected addPipe ( AbstractPipe $pipe ) : Workflow
$pipe Plum\Plum\Pipe\AbstractPipe
Résultat Workflow

addWriter() public méthode

public addWriter ( Plum\Plum\Writer\WriterInterface | array $element ) : Workflow
$element Plum\Plum\Writer\WriterInterface | array
Résultat Workflow

convertItem() protected méthode

Applies the given converter to the given item either if no filter is given or if the filter returns true.
protected convertItem ( mixed $item, ConverterPipe $pipe ) : mixed
$item mixed
$pipe Plum\Plum\Pipe\ConverterPipe
Résultat mixed

convertItemValue() protected méthode

Applies the given converter to the given field in the given item if no filter is given or if the filters returns true for the field.
protected convertItemValue ( mixed $item, ConverterPipe $pipe ) : mixed
$item mixed
$pipe Plum\Plum\Pipe\ConverterPipe
Résultat mixed

finishWriters() protected méthode

protected finishWriters ( WriterPipe[] $writers )
$writers Plum\Plum\Pipe\WriterPipe[]

getConverters() public méthode

public getConverters ( ) : ConverterPipe[]
Résultat Plum\Plum\Pipe\ConverterPipe[]

getFilters() public méthode

public getFilters ( ) : FilterPipe[]
Résultat Plum\Plum\Pipe\FilterPipe[]

getPipeline() public méthode

public getPipeline ( string | null $type = null ) : AbstractPipe[]
$type string | null
Résultat Plum\Plum\Pipe\AbstractPipe[]

getWriters() public méthode

public getWriters ( ) : WriterPipe[]
Résultat Plum\Plum\Pipe\WriterPipe[]

prepareWriters() protected méthode

protected prepareWriters ( WriterPipe[] $writers )
$writers Plum\Plum\Pipe\WriterPipe[]

process() public méthode

public process ( Plum\Plum\Reader\ReaderInterface[] | Plum\Plum\Reader\ReaderInterface $readers ) : Result
$readers Plum\Plum\Reader\ReaderInterface[] | Plum\Plum\Reader\ReaderInterface
Résultat Result

processItem() protected méthode

protected processItem ( mixed $item, Result $result )
$item mixed
$result Result

processReader() protected méthode

protected processReader ( Plum\Plum\Reader\ReaderInterface $reader, Result $result )
$reader Plum\Plum\Reader\ReaderInterface
$result Result

writeItem() protected méthode

Writes the given item to the given writer if the no filter is given or the filter returns true.
protected writeItem ( mixed $item, WriterPipe $pipe ) : boolean
$item mixed
$pipe Plum\Plum\Pipe\WriterPipe
Résultat boolean `true` if the item has been written, `false` if not.