<?php

namespace Fifa\ConnectId\Sdk\Registration\Model;

use Fifa\ConnectId\Sdk\Api\Model\PersonRegistrationContextType;
use Fifa\ConnectId\Sdk\Model\PersonDuplicateWithDetails;
use Fifa\ConnectServiceBus\Sdk\Utils\ToStringConverter;

/**
 * Class DuplicatesOfRegisteredPerson
 * @package Fifa\ConnectId\Sdk\Registration\Model
 */
class DuplicatesOfRegisteredPerson
{
    /**
     * @var PersonRegistrationContextType
     */
    private $personRegistrationContext;

    /**
     * @var PersonDuplicateWithDetails[]
     */
    private $duplicatesWithDetails;

    /**
     * Constructor
     *
     * @param PersonRegistrationContextType $personRegistrationContext
     * @param PersonDuplicateWithDetails[] $duplicatesWithDetails
     */
    public function __construct(PersonRegistrationContextType $personRegistrationContext, array $duplicatesWithDetails)
    {
        $this->personRegistrationContext = $personRegistrationContext;
        $this->duplicatesWithDetails = $duplicatesWithDetails;
    }

    /**
     * @return PersonDuplicateWithDetails[]
     */
    public function getDuplicatesWithDetails(): array
    {
        return $this->duplicatesWithDetails;
    }

    /**
     * @return PersonRegistrationContextType
     */
    public function getPersonRegistrationContext(): PersonRegistrationContextType
    {
        return $this->personRegistrationContext;
    }

    public function __toString()
    {
        return 'Context: ' . $this->personRegistrationContext . ' Duplicates: ' . ToStringConverter::arrayToString($this->duplicatesWithDetails);
    }
}