<?php

namespace App\AAS_Bundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use App\AAS_Bundle\Utils\AAS as AAS;

/**
 * Person
 */
class Person
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $surname;

    /**
     * @var string
     */
    private $name;

    /**
     * @var string
     */
    private $patronymic;

    /**
     * @var string
     */
    private $position;

    /**
     * @var \App\AAS_Bundle\Entity\Witness
     */
    private $witness;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $phone_numbers;

    /**
     * @var \App\AAS_Bundle\Entity\Team
     */
    private $team;


    /**
     * @var \DateTime
     */
    private $created_at;

    /**
     * @var \DateTime
     */
    private $updated_at;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->phone_numbers = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set surname
     *
     * @param string $surname
     * @return Person
     */
    public function setSurname($surname)
    {
        $this->surname = $surname;
    
        return $this;
    }

    /**
     * Get surname
     *
     * @return string 
     */
    public function getSurname()
    {
        return $this->surname;
    }

    public function getSurnameSlug()
    {
        return AAS::slugify($this->getSurname());
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Person
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    public function getNameSlug()
    {
        return AAS::slugify($this->getName());
    }

    /**
     * Set patronymic
     *
     * @param string $patronymic
     * @return Person
     */
    public function setPatronymic($patronymic)
    {
        $this->patronymic = $patronymic;
    
        return $this;
    }

    /**
     * Get patronymic
     *
     * @return string 
     */
    public function getPatronymic()
    {
        return $this->patronymic;
    }

    public function getPatronymicSlug()
    {
        return AAS::slugify($this->getPatronymic());
    }

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return Person
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;
    
        return $this;
    }

    /**
     * Get created_at
     *
     * @return \DateTime 
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return Person
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;
    
        return $this;
    }

    /**
     * Get updated_at
     *
     * @return \DateTime 
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }
    /**
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        if(!$this->getCreatedAt())
        {
            $this->created_at = new \DateTime();
        }
    }

    /**
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        $this->updated_at = new \DateTime();
    }
    /**
     * @var \App\AAS_Bundle\Entity\SecurityPerson
     */
    private $security_person;


    /**
     * Set security_person
     *
     * @param \App\AAS_Bundle\Entity\SecurityPerson $securityPerson
     * @return Person
     */
    public function setSecurityPerson(\App\AAS_Bundle\Entity\SecurityPerson $securityPerson = null)
    {
        $this->security_person = $securityPerson;
    
        return $this;
    }

    /**
     * Get security_person
     *
     * @return \App\AAS_Bundle\Entity\SecurityPerson 
     */
    public function getSecurityPerson()
    {
        return $this->security_person;
    }

    /**
     * Set position
     *
     * @param string $position
     * @return Person
     */
    public function setPosition($position)
    {
        $this->position = $position;
    
        return $this;
    }

    /**
     * Get position
     *
     * @return string 
     */
    public function getPosition()
    {
        return $this->position;
    }

    /**
     * Set witness
     *
     * @param \App\AAS_Bundle\Entity\Witness $witness
     * @return Person
     */
    public function setWitness(\App\AAS_Bundle\Entity\Witness $witness = null)
    {
        $this->witness = $witness;
    
        return $this;
    }

    /**
     * Get witness
     *
     * @return \App\AAS_Bundle\Entity\Witness 
     */
    public function getWitness()
    {
        return $this->witness;
    }

    /**
     * Add phone_numbers
     *
     * @param \App\AAS_Bundle\Entity\PhoneNumber $phoneNumbers
     * @return Person
     */
    public function addPhoneNumber(\App\AAS_Bundle\Entity\PhoneNumber $phoneNumbers)
    {
        $this->phone_numbers[] = $phoneNumbers;
    
        return $this;
    }

    /**
     * Remove phone_numbers
     *
     * @param \App\AAS_Bundle\Entity\PhoneNumber $phoneNumbers
     */
    public function removePhoneNumber(\App\AAS_Bundle\Entity\PhoneNumber $phoneNumbers)
    {
        $this->phone_numbers->removeElement($phoneNumbers);
    }

    /**
     * Get phone_numbers
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getPhoneNumbers()
    {
        return $this->phone_numbers;
    }

    /**
     * Set team
     *
     * @param \App\AAS_Bundle\Entity\Team $team
     * @return Person
     */
    public function setTeam(\App\AAS_Bundle\Entity\Team $team = null)
    {
        $this->team = $team;
    
        return $this;
    }

    /**
     * Get team
     *
     * @return \App\AAS_Bundle\Entity\Team 
     */
    public function getTeam()
    {
        return $this->team;
    }
    /**
     * @var \App\AAS_Bundle\Entity\MedicalCommission
     */
    private $medical_commission;


    /**
     * Set medical_commission
     *
     * @param \App\AAS_Bundle\Entity\MedicalCommission $medicalCommission
     * @return Person
     */
    public function setMedicalCommission(\App\AAS_Bundle\Entity\MedicalCommission $medicalCommission = null)
    {
        $this->medical_commission = $medicalCommission;
    
        return $this;
    }

    /**
     * Get medical_commission
     *
     * @return \App\AAS_Bundle\Entity\MedicalCommission 
     */
    public function getMedicalCommission()
    {
        return $this->medical_commission;
    }
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $admissions;


    /**
     * Add admissions
     *
     * @param \App\AAS_Bundle\Entity\Admission $admissions
     * @return Person
     */
    public function addAdmission(\App\AAS_Bundle\Entity\Admission $admissions)
    {
        $this->admissions[] = $admissions;
    
        return $this;
    }

    /**
     * Remove admissions
     *
     * @param \App\AAS_Bundle\Entity\Admission $admissions
     */
    public function removeAdmission(\App\AAS_Bundle\Entity\Admission $admissions)
    {
        $this->admissions->removeElement($admissions);
    }

    /**
     * Get admissions
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getAdmissions()
    {
        return $this->admissions;
    }
    /**
     * @var \App\AAS_Bundle\Entity\BusinessTripGroup
     */
    private $business_trip_group;


    /**
     * Set business_trip_group
     *
     * @param \App\AAS_Bundle\Entity\BusinessTripGroup $businessTripGroup
     * @return Person
     */
    public function setBusinessTripGroup(\App\AAS_Bundle\Entity\BusinessTripGroup $businessTripGroup = null)
    {
        $this->business_trip_group = $businessTripGroup;
    
        return $this;
    }

    /**
     * Get business_trip_group
     *
     * @return \App\AAS_Bundle\Entity\BusinessTripGroup 
     */
    public function getBusinessTripGroup()
    {
        return $this->business_trip_group;
    }
}
