src/Utilities/Helper.php
public static function includeInArray($item, $array)
    {
        if (self::isItemOrderInvalid($item, $array)) {
            return array_merge($array, [$item['name'] => $item['content']]);
        }

        $count = 0;
        $last  = $array;
        $first = [];
        foreach ($array as $key => $value) {
            if ($count == $item['order']) {
                return array_merge($first, [$item['name'] => $item['content']], $last);
            }

            unset($last[$key]);
            $first[$key] = $value;

            $count++;
        }
    }
public static function includeInArray($item, $array)
    {
        if (self::isItemOrderInvalid($item, $array)) {
            return array_merge($array, [$item['name'] => $item['content']]);
        }

        $count = 0;
        $last  = $array;
        $first = [];
        foreach ($array as $key => $value) {
            if ($count == $item['order']) {
                return array_merge($first, [$item['name'] => $item['content']], $last);
            }

            unset($last[$key]);
            $first[$key] = $value;

            $count++;
        }
    }
public static function includeInArray ( $ item , $ array ) { if ( self :: isItemOrderInvalid ( $ item , $ array ) ) { return array_merge ( $ array , [ $ item [ 'name' ] => $ item [ 'content' ] ] ) ; } $ count = 0 ; $ last = $ array ; $ first = [ ] ; foreach ( $ array as $ key => $ value ) { if ( $ count == $ item [ 'order' ] ) { return array_merge ( $ first , [ $ item [ 'name' ] => $ item [ 'content' ] ] , $ last ) ; } unset ( $ last [ $ key ] ) ; $ first [ $ key ] = $ value ; $ count ++ ; } }
Places item of extra columns into results by care of their order.

@param array $item
@param array $array
@return array
Places item of extra columns into results by care of their order .