dataOutput

This hook is triggered after completing jobs and before passing the data to the output departments.

Available from CustomCatalog 2.0

Parameters

  1. array $arrSet

    The result set after completing the api jobs.

  2. object (API) $objAPI

    The api instance

Return values

Expects value $arrSet as return value or a sequential array index => array(key => value) that should be the output.

Example

<?php

// config.php
$GLOBALS['CUSTOMCATALOG_HOOKS']['dataOutput'][] = array('MyClass', 'myDataOutputCallback');

// MyClass.php
public function myDataOutputCallback($arrSet, $objApi)
{
    if($objApi->getTable() == 'my_cc_table')
    {
        foreach($arrSet as $i => $data)
        {
            // set pid to 10
            $data['pid'] = 10;

            // set data
            $arrSet[$i] = $data;
        }
    }

    return $arrSet;
}

results matching ""

    No results matching ""