<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use RxConnexionBundle\Entity\Base\BaseEntity;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\ReferringHealthFacilityChartNoteRepository")
 * @ORM\Table(name="referring_health_facility_chart_note")
 */

class ReferringHealthFacilityChartNoteEntity extends BaseEntity
{
    /**
     * @ORM\Column(name="note", type="text", nullable=true)
     */
    protected $note;

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

    /**
     * @ORM\ManyToOne(targetEntity="RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity", inversedBy="referringHealthFacilityChartNotes")
     * @ORM\JoinColumn(name="referring_health_facility_chart_id", referencedColumnName="id")
     */
    protected $referringHealthFacilityChart;

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

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/
    /**
     * Get createdAtAsString
     *
     * @return string
     */
    public function getCreatedAtAsString() {
        $dttst = new DateTimeToStringTransformer();
        return date('m/d/Y H:i A', strtotime($dttst->transform(new \DateTime())));
    }


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



    /**
     * Set note
     *
     * @param string $note
     *
     * @return ReferringHealthFacilityChartNoteEntity
     */
    public function setNote($note)
    {
        $this->note = $note;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set referringHealthFacility
     *
     * @param \RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacility
     *
     * @return ReferringHealthFacilityChartNoteEntity
     */
    public function setReferringHealthFacility(\RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacility = null)
    {
        $this->referringHealthFacility = $referringHealthFacility;

        return $this;
    }

    /**
     * Get referringHealthFacility
     *
     * @return \RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity
     */
    public function getReferringHealthFacility()
    {
        return $this->referringHealthFacility;
    }

    /**
     * Set referringHealthFacilityChart
     *
     * @param \RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacilityChart
     *
     * @return ReferringHealthFacilityChartNoteEntity
     */
    public function setReferringHealthFacilityChart(\RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacilityChart = null)
    {
        $this->referringHealthFacilityChart = $referringHealthFacilityChart;

        return $this;
    }

    /**
     * Get referringHealthFacilityChart
     *
     * @return \RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity
     */
    public function getReferringHealthFacilityChart()
    {
        return $this->referringHealthFacilityChart;
    }
}
