Logo of php-etl
Getting Started
🐘 Standalone šŸŽµ Symfony 🦢 Sylius
Core Concepts
The Concept Execution Context Item Types Custom Operations Glossary FAQ
ā›“ļø Operations
Building Blocks
Split Merge Repeat Safe
Extract
File Finder CSV JSON
Transform
External File Processor Filter Data Rule Transformer Split Item HTTP Client Log Callback
Aggregation
Simple Grouping
Load
CSV JSON
šŸ§‘ā€šŸ³ Cookbook
Without Context
Grouping / Aggregation Filtering Splitting/Forking Making your chains configurable Complex data to csv / Flatten Data Api to CSV N°1 Api to CSV N°2 Sub chains
With Context
Api to CSV Import external file
Custom Operations

PHP-ETL - Cook Books
Filtering data

We can also filter data preventing some of it from being propagated through all the chain, in our example it will prevent unsubscribed customers from being written in our final csv file. So we can add this opertion to our

The rule engine is used for the filtering, If the rule returns false, 0, empty string or null then the item will not be propagated. We can also inverse this rule, but changing negate: true, in this case the rule needs to return false for the item to be propagated.

This might seem limiting but the rule engine does support SymfonyExpressions which opens a whole lot of flexibility.

filter-unsubscribed:
  operation: filter
  options:
    rule: [{get : {field: 'IsSubscribed'}}]
    negate: false

Complete yaml

chain:
  read-file:
    operation: csv-read
    options: [] # The default delimeter,&

  filter-unsubscribed:
    operation: filter
    options:
      rule: [{get : {field: 'IsSubscribed'}}]
      negate: false

  write-new-file:
    operation: csv-write
    options:
      file: "output.csv"

Network

GitHub Repo Issues Good First Issues

Help Preserve This Project

Support for the continued development of php ETL. I maintain this project in my free time.

Support
Free & Open Source (MIT)