src/Google/AdsApi/AdManager/Util/v201805/Pql.php
public static function combineResultSets(
        ResultSet $first,
        ResultSet $second
    ) {
        $firstColumns = self::getColumnLabels($first);
        $secondColumns = self::getColumnLabels($second);

        if ($firstColumns !== $secondColumns) {
            throw new InvalidArgumentException(
                sprintf(
                    'First result set columns [%s] do not match second result '
                    . 'set columns [%s]',
                    implode(
                        ', ',
                        $firstColumns
                    ),
                    implode(', ', $secondColumns)
                )
            );
        }

        $combinedRows = $first->getRows();
        if (!empty($second->getRows())) {
            $combinedRows = array_merge($combinedRows, $second->getRows());
        }

        return new ResultSet($first->getColumnTypes(), $combinedRows);
    }
public static function combineResultSets(
        ResultSet $first,
        ResultSet $second
    ) {
        $firstColumns = self::getColumnLabels($first);
        $secondColumns = self::getColumnLabels($second);

        if ($firstColumns !== $secondColumns) {
            throw new InvalidArgumentException(
                sprintf(
                    'First result set columns [%s] do not match second result '
                    . 'set columns [%s]',
                    implode(
                        ', ',
                        $firstColumns
                    ),
                    implode(', ', $secondColumns)
                )
            );
        }

        $combinedRows = $first->getRows();
        if (!empty($second->getRows())) {
            $combinedRows = array_merge($combinedRows, $second->getRows());
        }

        return new ResultSet($first->getColumnTypes(), $combinedRows);
    }
public static function combineResultSets ( ResultSet $ first , ResultSet $ second ) { $ firstColumns = self :: getColumnLabels ( $ first ) ; $ secondColumns = self :: getColumnLabels ( $ second ) ; if ( $ firstColumns !== $ secondColumns ) { throw new InvalidArgumentException ( sprintf ( 'First result set columns [%s] do not match second result ' . 'set columns [%s]' , implode ( ', ' , $ firstColumns ) , implode ( ', ' , $ secondColumns ) ) ) ; } $ combinedRows = $ first -> getRows ( ) ; if ( ! empty ( $ second -> getRows ( ) ) ) { $ combinedRows = array_merge ( $ combinedRows , $ second -> getRows ( ) ) ; } return new ResultSet ( $ first -> getColumnTypes ( ) , $ combinedRows ) ; }
Combines the first and second result sets, if and only if, the columns
of both result sets match.

@param ResultSet $first the first result set
@param ResultSet $second the second result set
@return ResultSet the combined result set
@throws InvalidArgumentException if the result sets to combine do not
have identical column headers
Combines the first and second result sets if and only if the columns of both result sets match .