<?php
/**
 * @author Ulrich Hecht <ulrich.hecht@hecht-software.de>
 * @date 02/10/2017
 */

namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;

class Traveler
{
    // Used in SternToursCrmBookingExports, expected to be equivalent to salutation (as defined in BookingRequest)
    const MALE = 1;
    const FEMALE = 2;

    /**
     * @Assert\NotNull
     * @Assert\Choice(choices={1,2})
     */
    private $sex;

    /**
     * @Assert\NotBlank()
     */
    private $firstName;

    /**
     * @Assert\NotBlank()
     */
    private $lastName;

    /**
     * @Assert\NotBlank()
     */
    private $birthDate;

    /**
     * @return int
     */
    public function getSex()
    {
        return $this->sex;
    }

    /**
     * @param int $sex
     */
    public function setSex($sex)
    {
        $this->sex = $sex;
    }

    /**
     * @return string
     */
    public function getFirstName()
    {
        return $this->firstName;
    }

    /**
     * @param string $firstName
     */
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;
    }

    /**
     * @return string
     */
    public function getLastName()
    {
        return $this->lastName;
    }

    /**
     * @param string $lastName
     */
    public function setLastName($lastName)
    {
        $this->lastName = $lastName;
    }

    /**
     * @return string
     */
    public function getBirthDate()
    {
        if(($this->birthDate instanceof String) && !strtotime($this->birthDate)){
            return '01.01.1900';
        }
        return $this->birthDate;
    }

    /**
     * @param string $birthDate
     */
    public function setBirthDate($birthDate)
    {

        $this->birthDate = $birthDate;
    }


}