<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use RxConnexionBundle\Entity\Base\BaseEntity;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\MaxDepth;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\PatientTicketRepository")
 * @ORM\Table(name="patient_ticket")
 */

class PatientTicketEntity extends BaseEntity
{

    /**
     * @ORM\Column(name="is_deleted", type="boolean")
     */
    protected $isDeleted;

    /**
     * @ORM\ManyToOne(targetEntity="TicketEntity", inversedBy="patientTickets")
     * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $ticket;

    /**
     * @ORM\ManyToOne(targetEntity="PatientEntity", inversedBy="patientTickets")
     * @ORM\JoinColumn(name="patient_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $patient;

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
        $this->isDeleted = 0;
    }

    public function __construct()
    {
    }


    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Setters and Getters																	  */
    /*--------------------------------------------------------------------------------------------------------*/

    /**
     * Set isDeleted
     *
     * @param boolean $isDeleted
     *
     * @return PatientTicketEntity
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

    /**
     * Get isDeleted
     *
     * @return boolean
     */
    public function getIsDeleted()
    {
        return $this->isDeleted;
    }

    /**
     * Set ticket
     *
     * @param \RxConnexionBundle\Entity\TicketEntity $ticket
     *
     * @return PatientTicketEntity
     */
    public function setTicket(\RxConnexionBundle\Entity\TicketEntity $ticket = null)
    {
        $this->ticket = $ticket;

        return $this;
    }

    /**
     * Get ticket
     *
     * @return \RxConnexionBundle\Entity\TicketEntity
     */
    public function getTicket()
    {
        return $this->ticket;
    }

    /**
     * Set patient
     *
     * @param \RxConnexionBundle\Entity\PatientEntity $patient
     *
     * @return PatientTicketEntity
     */
    public function setPatient(\RxConnexionBundle\Entity\PatientEntity $patient = null)
    {
        $this->patient = $patient;

        return $this;
    }

    /**
     * Get patient
     *
     * @return \RxConnexionBundle\Entity\PatientEntity
     */
    public function getPatient()
    {
        return $this->patient;
    }
}
