OnlyColumn

Introduction #

Sometime you may want to simplify your data flow by taking only some of columns to continue in datapipe. You can do so with OnlyColumn process. This process will act like a filter which only let some specified columns passing through. Other columns will be discarded.

Example #

<?php
use \koolreport\processes\OnlyColumn;
class MyReport extends \koolreport\KoolReport
{
    public function setup()
    {
        ...
        ->pipe(new OnlyColumn(array(
            "customerName","orderAmount"
        )))
        ...
    }
}

Code explanation:

  1. In this example, we use OnlyColumn process with two columns name input "customerName" and "orderAmount".
  2. After data is piped though the OnlyColumn process, only data of two columns "customerName" and "orderAmount" are available.

Get started with KoolReport

KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.