<?php


namespace Fifa\ConnectId\Sdk\Model\Transfer;

use DateTime;
use Fifa\ConnectId\Sdk\Util\ToString\Exception\ToStringException;
use Fifa\ConnectId\Sdk\Util\ToString\ToString;

class EmploymentContract
{
    /**
     * @var DocumentEmbedded
     * @required - required by SDK from business point of view, not required by FIFA Data Standard
     */
    public $EmploymentContractDocument;

    /**
     * Date in format "Y-m-d" (ref. http://php.net/manual/en/function.date.php)
     *
     * @var string
     */
    public $EmploymentContractStartDate;

    /**
     * Date in format "Y-m-d" (ref. http://php.net/manual/en/function.date.php)
     *
     * @var string
     */
    public $EmploymentContractEndDate;

    /**
     * EmploymentContract constructor.
     */
    public function __construct()
    {
    }

    /**
     * Gets DateTime object and sets its string representation to EmploymentContractEndDate property
     *
     * @param DateTime $employmentContractEndDate
     * @throws ToStringException
     */
    public function setEmploymentContractEndDate(DateTime $employmentContractEndDate)
    {
        $this->EmploymentContractEndDate = ToString::getValue($employmentContractEndDate);
    }

    /**
     * Gets DateTime object and sets its string representation to EmploymentContractStartDate property
     *
     * @param DateTime $employmentContractStartDate
     * @throws ToStringException
     */
    public function setEmploymentContractStartDate(DateTime $employmentContractStartDate)
    {
        $this->EmploymentContractStartDate = ToString::getValue($employmentContractStartDate);
    }

    /**
     * @return string
     */
    public function __toString()
    {
        $required = '';
        if (!is_null($this->EmploymentContractDocument)) {
            $required = sprintf('EmploymentContractDocument: %s', $this->EmploymentContractDocument->__toString());
        }

        $optional = sprintf('EmploymentContractStartDate: %s, EmploymentContractEndDate: %s, ', $this->EmploymentContractStartDate, $this->EmploymentContractEndDate);

        return sprintf('%s, %s', $required, $optional);
    }
}