CopyColumn

Introduction #

Sometime you may need to make a copy or duplicate a column so that you can do further transformation while keep the original column intact. The CopyColumn process will help you to do so.

Example #

<?php
use \koolreport\processes\CopyColumn;
class MyReport extends \koolreport\KoolReport
{
    public function setup()
    {
        ...
        ->pipe(new CopyColumn(array(
            "copy_of_name"=>"name",
            "copy_of_amount"=>"amount"
        )))
        ...
    }
}

Code explanation:

  1. In above example, we create new column "copy_of_name" from existed column "name". The new column will have the same data and meta data of existed column except for the name.
  2. The same for new column "copy_of_amount"