<?php

/**
 * Class CFApiFormatter
 */
class Cf_api_formatter
{
    /**
     * Merge columns API data with rows data
     * @param array $columnData
     * @param array $rowsData
     * @return array
     */
    public function merge_columns_with_rows(array $columnData, array $rowsData){
        $result = array();
        $columns = array_column($columnData, 'columnName');

        foreach ($rowsData as $key => $row){
            $result[] = array_combine($columns, $row);
        }

        return $result;
    }
}
