TransformService
extends BaseService
in package
Transform pipeline master service.
Pipelines are a series of callbacks used to modify content before storage:
$transform = new \Ceo\Services\TransformService;
$transform->registerPipeline('content', [
function($article) {
$article->content .= "\n\n<!-- Last built " . date('c') . "-->";
return $article
}
]);
...
$pipeline = $transform->pipelineFor('content');
$pipeline->transform($inputData);
Table of Contents
- $pipelines : mixed
- pipelineFor() : Pipeline
- Retrieve a pipline for a given type
- registerPipeline() : Pipeline
- Register or re-register a pipeline
Properties
$pipelines
protected
mixed
$pipelines
= []
Methods
pipelineFor()
Retrieve a pipline for a given type
public
pipelineFor(string $type) : Pipeline
Parameters
- $type : string
Return values
Pipeline —registerPipeline()
Register or re-register a pipeline
public
registerPipeline(string $type[, mixed $actions = [] ]) : Pipeline
Parameters
- $type : string
- $actions : mixed = []