<?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\ReferringProviderChartNoteRepository")
 * @ORM\Table(name="referring_provider_chart_note")
 */

class ReferringProviderChartNoteEntity 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\ReferringProviderChartEntity", inversedBy="referringProviderChartNotes")
     * @ORM\JoinColumn(name="referring_provider_chart_id", referencedColumnName="id")
     */
    protected $referringProviderChart;

    /**
     * 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 ReferringProviderChartNoteEntity
     */
    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 ReferringProviderChartNoteEntity
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

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

    /**
     * Set referringProviderChart
     *
     * @param \RxConnexionBundle\Entity\ReferringProviderChartEntity $referringProviderChart
     *
     * @return ReferringProviderChartNoteEntity
     */
    public function setReferringProviderChart(\RxConnexionBundle\Entity\ReferringProviderChartEntity $referringProviderChart = null)
    {
        $this->referringProviderChart = $referringProviderChart;

        return $this;
    }

    /**
     * Get referringProviderChart
     *
     * @return \RxConnexionBundle\Entity\ReferringProviderChartEntity
     */
    public function getReferringProviderChart()
    {
        return $this->referringProviderChart;
    }
}
