public function merge(Lead $source, Lead $destination): void
    {
        if (empty($source->getId()) || empty($destination->getId())) {
            throw new InvalidParamException('You need to specify two already existing leads in order to merge them');
        }

        $this->client->post($this->prepareUrlForKey('merge-leads'), [], [
            'destination' => $destination->getId(),
            'source' => $source->getId(),
        ]);
    }
public function merge(Lead $source, Lead $destination): void
    {
        if (empty($source->getId()) || empty($destination->getId())) {
            throw new InvalidParamException('You need to specify two already existing leads in order to merge them');
        }

        $this->client->post($this->prepareUrlForKey('merge-leads'), [], [
            'destination' => $destination->getId(),
            'source' => $source->getId(),
        ]);
    }
public function merge ( Lead $ source , Lead $ destination ) : void { if ( empty ( $ source -> getId ( ) ) || empty ( $ destination -> getId ( ) ) ) { throw new InvalidParamException ( 'You need to specify two already existing leads in order to merge them' ) ; } $ this -> client -> post ( $ this -> prepareUrlForKey ( 'merge-leads' ) , [ ] , [ 'destination' => $ destination -> getId ( ) , 'source' => $ source -> getId ( ) , ] ) ; }
Merges two leads.

@param Lead $source      The source lead (he will be deleted afterwards)
@param Lead $destination The lead to merge the data in

@throws InvalidParamException If any of the two leads have an invalid ID
Merges two leads .