<?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\TreatmentConsiderationRepository")
 * @ORM\Table(name="treatment_consideration", indexes={@ORM\Index(name="IDX_SEARCH_000", columns={"description"})})
 */

class TreatmentConsiderationEntity extends BaseEntity
{
    /**
     * @ORM\Column(type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $code;

    /**
     * @ORM\Column(type="string")
     * @Groups("forAudit")
     */
    protected $description;

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

    /**
     * @ORM\OneToMany(targetEntity="PatientTreatmentConsiderationEntity", mappedBy="treatmentConsideration", cascade={"remove"})
     */
    protected $patientTreatmentConsiderations;


    public function __construct()
    {
        $this->patientTreatmentConsiderations = new ArrayCollection();
    }

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

    /*--------------------------------------------------------------------------------------------------------*/
    /*					User Defined Setters and Getters													  */
    /*--------------------------------------------------------------------------------------------------------*/

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


    /**
     * Set code
     *
     * @param string $code
     *
     * @return TreatmentConsiderationEntity
     */
    public function setCode($code)
    {
        $this->code = $code;

        return $this;
    }

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

    /**
     * Set description
     *
     * @param string $description
     *
     * @return TreatmentConsiderationEntity
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Add patientTreatmentConsideration
     *
     * @param \RxConnexionBundle\Entity\PatientTreatmentConsiderationEntity $patientTreatmentConsideration
     *
     * @return TreatmentConsiderationEntity
     */
    public function addPatientTreatmentConsideration(\RxConnexionBundle\Entity\PatientTreatmentConsiderationEntity $patientTreatmentConsideration)
    {
        $this->patientTreatmentConsiderations[] = $patientTreatmentConsideration;

        return $this;
    }

    /**
     * Remove patientTreatmentConsideration
     *
     * @param \RxConnexionBundle\Entity\PatientTreatmentConsiderationEntity $patientTreatmentConsideration
     */
    public function removePatientTreatmentConsideration(\RxConnexionBundle\Entity\PatientTreatmentConsiderationEntity $patientTreatmentConsideration)
    {
        $this->patientTreatmentConsiderations->removeElement($patientTreatmentConsideration);
    }

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