<?php

namespace RxConnexionBundle\Entity;

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

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\MarketingStaffScheduleRequestRepository")
 * @ORM\Table(name="marketing_staff_schedule_request")
 */

class MarketingStaffScheduleRequestEntity extends BaseEntity
{
    /**
     * @ORM\Column(name="start_time", type="string", nullable=true)
     */
    protected $startTime;

    /**
     * @ORM\Column(name="start_time_hour", type="integer", nullable=true)
     */
    protected $startTimeHour;

    /**
     * @ORM\Column(name="start_time_minute", type="integer", nullable=true)
     */
    protected $startTimeMinute;

    /**
     * @ORM\Column(name="start_time_period", type="string", nullable=true)
     */
    protected $startTimePeriod;

    /**
     * @ORM\Column(name="end_time", type="string", nullable=true)
     */
    protected $endTime;

    /**
     * @ORM\Column(name="end_time_hour", type="integer", nullable=true)
     */
    protected $endTimeHour;

    /**
     * @ORM\Column(name="end_time_minute", type="integer", nullable=true)
     */
    protected $endTimeMinute;

    /**
     * @ORM\Column(name="end_time_period", type="string", nullable=true)
     */
    protected $endTimePeriod;

    /**
     * @ORM\Column(name="schedule_date", type="datetime")
     */
    protected $scheduleDate;

    /**
     * @ORM\Column(name="notes", type="text", nullable=true)
     */
    protected $notes;

    /**
     * @ORM\Column(name="deny_notes", type="text", nullable=true)
     */
    protected $denyNotes;

    /**
     * @ORM\Column(name="status", type="string", nullable=true)
     */
    protected $status;

    /**
     * @ORM\Column(name="queue_no", type="integer", nullable=true)
     */
    protected $queueNo;

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

    /**
     * @ORM\ManyToOne(targetEntity="GeneralUserEntity", inversedBy="marketingStaffScheduleRequests")
     * @ORM\JoinColumn(name="general_user_id", referencedColumnName="id")
     */
    protected $generalUser;

    /**
     * @ORM\ManyToOne(targetEntity="HealthFacilityEntity", inversedBy="marketingStaffScheduleRequests")
     * @ORM\JoinColumn(name="health_facility_id", referencedColumnName="id")
     */
    protected $healthFacility;

    /**
     * @ORM\ManyToOne(targetEntity="RxConnexionBundle\Entity\MarketingStaffEntity", inversedBy="marketingStaffScheduleRequests")
     * @ORM\JoinColumn(name="marketing_staff_id", referencedColumnName="id")
     */
    protected $marketingStaff;

    /**
     * @ORM\ManyToOne(targetEntity="ChartTypeEntity", inversedBy="marketingStaffScheduleRequests")
     * @ORM\JoinColumn(name="chart_type_id", referencedColumnName="id")
     */
    protected $chartType;

    /**
     * @ORM\OneToOne(targetEntity="RxConnexionBundle\Entity\MarketingStaffScheduleEntity", mappedBy="marketingStaffScheduleRequest")
     */
    protected $marketingStaffSchedule;

    /**
     * @ORM\OneToOne(targetEntity="MarketingStaffScheduleQueuedEntity", mappedBy="marketingStaffScheduleRequest")
     */
    protected $marketingStaffScheduleQueued;


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

    }

    /**
     * Set updatedAt
     *
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        parent::setUpdatedAtValue();
        $this->updateStartEndTime();
    }

    /**
     * Concatenate start and end time
     */
    public function updateStartEndTime() {

        $this->startTime = sprintf('%002d', $this->startTimeHour) . ':' . sprintf('%002d', $this->startTimeMinute) . ' ' . $this->startTimePeriod;
        $this->endTime = sprintf('%002d', $this->endTimeHour) . ':' . sprintf('%002d', $this->endTimeMinute) . ' ' . $this->endTimePeriod;

        return $this;
    }

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

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


    /**
     * Set startTime
     *
     * @param string $startTime
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setStartTime($startTime)
    {
        $this->startTime = $startTime;

        return $this;
    }

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

    /**
     * Set startTimeHour
     *
     * @param integer $startTimeHour
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setStartTimeHour($startTimeHour)
    {
        $this->startTimeHour = $startTimeHour;

        return $this;
    }

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

    /**
     * Set startTimeMinute
     *
     * @param integer $startTimeMinute
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setStartTimeMinute($startTimeMinute)
    {
        $this->startTimeMinute = $startTimeMinute;

        return $this;
    }

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

    /**
     * Set startTimePeriod
     *
     * @param string $startTimePeriod
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setStartTimePeriod($startTimePeriod)
    {
        $this->startTimePeriod = $startTimePeriod;

        return $this;
    }

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

    /**
     * Set endTime
     *
     * @param string $endTime
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setEndTime($endTime)
    {
        $this->endTime = $endTime;

        return $this;
    }

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

    /**
     * Set endTimeHour
     *
     * @param integer $endTimeHour
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setEndTimeHour($endTimeHour)
    {
        $this->endTimeHour = $endTimeHour;

        return $this;
    }

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

    /**
     * Set endTimeMinute
     *
     * @param integer $endTimeMinute
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setEndTimeMinute($endTimeMinute)
    {
        $this->endTimeMinute = $endTimeMinute;

        return $this;
    }

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

    /**
     * Set endTimePeriod
     *
     * @param string $endTimePeriod
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setEndTimePeriod($endTimePeriod)
    {
        $this->endTimePeriod = $endTimePeriod;

        return $this;
    }

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

    /**
     * Set scheduleDate
     *
     * @param \DateTime $scheduleDate
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setScheduleDate($scheduleDate)
    {
        $this->scheduleDate = $scheduleDate;

        return $this;
    }

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

    /**
     * Set notes
     *
     * @param string $notes
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setNotes($notes)
    {
        $this->notes = $notes;

        return $this;
    }

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

    /**
     * Set denyNotes
     *
     * @param string $denyNotes
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setDenyNotes($denyNotes)
    {
        $this->denyNotes = $denyNotes;

        return $this;
    }

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

    /**
     * Set status
     *
     * @param string $status
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

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

    /**
     * Set queueNo
     *
     * @param integer $queueNo
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setQueueNo($queueNo)
    {
        $this->queueNo = $queueNo;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set generalUser
     *
     * @param \RxConnexionBundle\Entity\GeneralUserEntity $generalUser
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setGeneralUser(\RxConnexionBundle\Entity\GeneralUserEntity $generalUser = null)
    {
        $this->generalUser = $generalUser;

        return $this;
    }

    /**
     * Get generalUser
     *
     * @return \RxConnexionBundle\Entity\GeneralUserEntity
     */
    public function getGeneralUser()
    {
        return $this->generalUser;
    }

    /**
     * Set healthFacility
     *
     * @param \RxConnexionBundle\Entity\HealthFacilityEntity $healthFacility
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setHealthFacility(\RxConnexionBundle\Entity\HealthFacilityEntity $healthFacility = null)
    {
        $this->healthFacility = $healthFacility;

        return $this;
    }

    /**
     * Get healthFacility
     *
     * @return \RxConnexionBundle\Entity\HealthFacilityEntity
     */
    public function getHealthFacility()
    {
        return $this->healthFacility;
    }

    /**
     * Set marketingStaff
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffEntity $marketingStaff
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setMarketingStaff(\RxConnexionBundle\Entity\MarketingStaffEntity $marketingStaff = null)
    {
        $this->marketingStaff = $marketingStaff;

        return $this;
    }

    /**
     * Get marketingStaff
     *
     * @return \RxConnexionBundle\Entity\MarketingStaffEntity
     */
    public function getMarketingStaff()
    {
        return $this->marketingStaff;
    }

    /**
     * Set chartType
     *
     * @param \RxConnexionBundle\Entity\ChartTypeEntity $chartType
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setChartType(\RxConnexionBundle\Entity\ChartTypeEntity $chartType = null)
    {
        $this->chartType = $chartType;

        return $this;
    }

    /**
     * Get chartType
     *
     * @return \RxConnexionBundle\Entity\ChartTypeEntity
     */
    public function getChartType()
    {
        return $this->chartType;
    }

    /**
     * Set marketingStaffSchedule
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleEntity $marketingStaffSchedule
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setMarketingStaffSchedule(\RxConnexionBundle\Entity\MarketingStaffScheduleEntity $marketingStaffSchedule = null)
    {
        $this->marketingStaffSchedule = $marketingStaffSchedule;

        return $this;
    }

    /**
     * Get marketingStaffSchedule
     *
     * @return \RxConnexionBundle\Entity\MarketingStaffScheduleEntity
     */
    public function getMarketingStaffSchedule()
    {
        return $this->marketingStaffSchedule;
    }

    /**
     * Set marketingStaffScheduleQueued
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffScheduleQueued
     *
     * @return MarketingStaffScheduleRequestEntity
     */
    public function setMarketingStaffScheduleQueued(\RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffScheduleQueued = null)
    {
        $this->marketingStaffScheduleQueued = $marketingStaffScheduleQueued;

        return $this;
    }

    /**
     * Get marketingStaffScheduleQueued
     *
     * @return \RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity
     */
    public function getMarketingStaffScheduleQueued()
    {
        return $this->marketingStaffScheduleQueued;
    }
}
