public function union($fields, $second)
    {
        return array_map(
            'unserialize', array_unique(
                array_map(
                    'serialize', array_merge(
                        $this->select($fields),
                        $second->select($fields)
                    )
                )
            )
        );
    }
public function union($fields, $second)
    {
        return array_map(
            'unserialize', array_unique(
                array_map(
                    'serialize', array_merge(
                        $this->select($fields),
                        $second->select($fields)
                    )
                )
            )
        );
    }
public function union ( $ fields , $ second ) { return array_map ( 'unserialize' , array_unique ( array_map ( 'serialize' , array_merge ( $ this -> select ( $ fields ) , $ second -> select ( $ fields ) ) ) ) ) ; }
Merges two databases, removing duplicates.

@param array $fields     the fields to merge
@param Database $second  the second database to merge
@return array            the merged array
Merges two databases removing duplicates .