<?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;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\MaxDepth;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\MarketingStaffRepository")
 * @ORM\Table(name="marketing_staff")
 */

class MarketingStaffEntity extends BaseEntity
{
    const GENDER_MALE = 'Male';
    const GENDER_FEMALE = 'Female';

    /**
     * @ORM\Column(name="first_name", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $firstName;

    /**
     * @ORM\Column(name="middle_name", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $middleName;

    /**
     * @ORM\Column(name="last_name", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $lastName;

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

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

    /**
     * @ORM\Column(name="birth_date", type="datetime", nullable=true)
     * @Groups("forAudit")
     */
    protected $birthDate;

    /**
     * @ORM\Column(type="string", nullable=true, nullable=true)
     * @Groups("forAudit")
     */
    protected $address;

    /**
     * @ORM\Column(type="string", nullable=true, nullable=true)
     * @Groups("forAudit")
     */
    protected $street;

    /**
     * @ORM\Column(name="mobile_no", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $mobileNo;

    /**
     * @ORM\Column(name="mobile_no_two", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $mobileNoTwo;

    /**
     * @ORM\Column(name="mobile_no_three", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $mobileNoThree;

    /**
     * @ORM\Column(name="phone_no", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $phoneNo;

    /**
     * @ORM\Column(name="phone_no_two", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $phoneNoTwo;

    /**
     * @ORM\Column(name="phone_no_three", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $phoneNoThree;

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

    /**
     * @ORM\Column(name="email_two", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $emailTwo;

    /**
     * @ORM\Column(name="email_three", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $emailThree;

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

    /**
     * @ORM\Column(name="photo_description", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $photoDescription;

    /**
     * @ORM\Column(name="parsed_photo_description", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $parsedPhotoDescription;

    /**
     * @ORM\Column(name="old_sys_id", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $oldSysId;

    /**
     * @ORM\Column(name="start_date", type="datetime")
     * @Groups("forAudit")
     */
    protected $startDate;

    /**
     * @ORM\Column(name="end_date", type="datetime", nullable=true)
     * @Groups("forAudit")
     */
    protected $endDate;

    /**
     * @ORM\Column(name="emergency_contact_name", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $emergencyContactName;

    /**
     * @ORM\Column(name="emergency_contact_no", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $emergencyContactNo;

    /**
     * @ORM\Column(name="is_active", type="boolean")
     * @Groups("forAudit")
     */
    protected $isActive;

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

    /**
     * @ORM\ManyToOne(targetEntity="MarketingStaffTypeEntity", inversedBy="marketingStaffs")
     * @ORM\JoinColumn(name="marketing_staff_type_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $marketingStaffType;

    /**
     * @ORM\ManyToOne(targetEntity="CityEntity", inversedBy="marketingStaffs")
     * @ORM\JoinColumn(name="city_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $city;

    /**
     * @ORM\ManyToOne(targetEntity="PostalCodeEntity", inversedBy="marketingStaffs")
     * @ORM\JoinColumn(name="postal_code_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $postalCode;

    /**
     * @ORM\OneToMany(targetEntity="RxConnexionBundle\Entity\AccountUserEntity", mappedBy="marketingStaff")
     */
    protected $accountUsers;

    /**
     * @ORM\OneToMany(targetEntity="RxConnexionBundle\Entity\MarketingStaffScheduleEntity", mappedBy="marketingStaff")
     */
    protected $marketingStaffSchedules;

    /**
     * @ORM\OneToMany(targetEntity="MarketingStaffScheduleQueuedEntity", mappedBy="marketingStaff")
     */
    protected $marketingStaffSchedulesQueued;

    /**
     * @ORM\OneToMany(targetEntity="MarketingStaffScheduleRequestEntity", mappedBy="marketingStaff")
     */
    protected $marketingStaffScheduleRequests;

    /**
     * @ORM\OneToMany(targetEntity="RxConnexionBundle\Entity\ReferringProviderChartEntity", mappedBy="marketingStaff")
     */
    protected $referringProviderCharts;

    /**
     * @ORM\OneToMany(targetEntity="RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity", mappedBy="marketingStaff")
     */
    protected $referringHealthFacilityCharts;

    /**
     * @ORM\OneToMany(targetEntity="MarketingStaffHealthFacilityEntity", mappedBy="marketingStaff", cascade={"remove"})
     */
    protected $healthFacilities;

    /**
     * @ORM\OneToMany(targetEntity="MarketingStaffWorkScheduleEntity", mappedBy="marketingStaff", cascade={"remove"})
     */
    protected $marketingStaffWorkSchedules;

    /**
     * @ORM\OneToMany(targetEntity="PatientEntity", mappedBy="primaryMarketingStaff")
     */
    protected $patientPrimaryMarketingStaffs;

    /**
     * @ORM\OneToOne(targetEntity="PatientEntity", mappedBy="marketingStaff")
     */
    protected $patient;

    public function __construct()
    {
        $this->marketingStaffSchedules = new ArrayCollection();
        $this->marketingStaffSchedulesQueued = new ArrayCollection();
        $this->marketingStaffScheduleRequests = new ArrayCollection();
        $this->referringProviderCharts = new ArrayCollection();
        $this->referringHealthFacilityCharts = new ArrayCollection();
        $this->healthFacilities = new ArrayCollection();
        $this->marketingStaffWorkSchedules = new ArrayCollection();
        $this->accountUsers = new ArrayCollection();
        //$this->patient = new ArrayCollection();
        //$this->primaryPatientChart = new ArrayCollection();
    }

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
        $this->isDeleted = 0;
        $this->fullName = ucfirst($this->firstName) . ' ' . ucfirst($this->lastName);
        $this->updateAddress();
    }

    /**
     * Set updatedAt
     *
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        parent::setUpdatedAtValue();
        $this->fullName = ucfirst($this->firstName) . ' ' . ucfirst($this->lastName);
        $this->updateAddress();
    }

    /**
     * Remove the photo from the disk
     *
     * @ORM\PreRemove
     */
    public function removePhoto() {

        $file = $this->getUploadRootDir() . '/' . $this->parsedPhotoDescription;
        if(!empty($this->parsedPhotoDescription) && file_exists($file)) unlink($file);
    }

    /**
     * Concatenate address
     */
    public function updateAddress() {
        $this->address = $this->street . ' ' . ($this->city ? $this->city->getDescription() . ', ' . ($this->city->getProvince() != null ? $this->city->getProvince()->getDescription() : '') . ' ' . ($this->city->getProvince() != null ? $this->city->getProvince()->getCountry()->getDescription() : '')  . ' ' : '') . ($this->getPostalCode() ? $this->getPostalCode()->getDescription() : '');
    }

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


    /**
     * Get defaultMarketingStaffHealthFacilityId
     *
     * @return string
     */
    public function getDefaultMarketingStaffHealthFacilityId(){
        $id = '';
        foreach($this->getHealthFacilities() as $healthFacility){
            if($healthFacility->getIsScheduleDefault()){
                return $healthFacility->getHealthFacility()->getId();
            }
        }
        return $id;
    }

    /**
     * Get startDateAsString
     *
     * @return string
     */
    public function getStartDateAsString() {

        $dttst = new DateTimeToStringTransformer();
        return !empty($this->startDate) ? date('m/d/Y', strtotime($dttst->transform($this->startDate))) : '';
    }

    /**
     * Get endDateAsString
     *
     * @return string
     */
    public function getEndDateAsString() {

        $dttst = new DateTimeToStringTransformer();
        return !empty($this->endDate) ? date('m/d/Y', strtotime($dttst->transform($this->endDate))) : '';
    }

    /**
     * Get uploadDir
     *
     * @return string
     */
    public function getUploadDir() {

        return 'uploads/marketingStaff/photo';
    }

    /**
     * Get uploadRootDir
     *
     * @return string
     */
    public function getUploadRootDir() {

        return __DIR__ . '/../../../web/' . $this->getUploadDir();
    }

    /**
     * get photoWebPath
     *
     * @return string
     */
    public function getPhotoWebPath() {

        $parsedDesc = $this->parsedPhotoDescription;
        $file = $this->getUploadRootDir() . '/' . $parsedDesc;

        if(!empty($parsedDesc) && file_exists($file)) {
            return '/' . $this->getUploadDir() . '/' . $parsedDesc;
        } else {
            return '';
        }
    }

    /**
     * Get allHealthFacilityIdsToArray
     *
     * @return array
     */
    public function getAllHealthFacilityIdsToArray() {

        $healthFacilityIds = array();

        foreach($this->healthFacilities as $healthFacility) {
            $healthFacilityIds[] = $healthFacility->getHealthFacility()->getId();
        }

        return $healthFacilityIds;
    }

    /**
     * Get concatenatedHealthFacilityIdsBySpace
     *
     * @return string
     */
    public function getConcatenatedHealthFacilityIdsBySpace() {

        $concatenatedHealthFacilityIdsBySpace = '';

        foreach($this->healthFacilities as $healthFacility) {

            $concatenatedHealthFacilityIdsBySpace .= (!empty($concatenatedHealthFacilityIdsBySpace) ? ' ' : '') . $healthFacility->getHealthFacility()->getId();
        }

        return $concatenatedHealthFacilityIdsBySpace;
    }

    /**
     * Get birthDateAsString
     *
     * @return string
     */
    public function getBirthDateAsString() {

        $dttst = new DateTimeToStringTransformer();
        return !empty($this->birthDate) ? date('m/d/Y', strtotime($dttst->transform($this->birthDate))) : '';
    }

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


    /**
     * Set firstName
     *
     * @param string $firstName
     *
     * @return MarketingStaffEntity
     */
    public function setFirstName($firstName)
    {
        $this->firstName = $firstName;

        return $this;
    }

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

    /**
     * Set middleName
     *
     * @param string $middleName
     *
     * @return MarketingStaffEntity
     */
    public function setMiddleName($middleName)
    {
        $this->middleName = $middleName;

        return $this;
    }

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

    /**
     * Set lastName
     *
     * @param string $lastName
     *
     * @return MarketingStaffEntity
     */
    public function setLastName($lastName)
    {
        $this->lastName = $lastName;

        return $this;
    }

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

    /**
     * Set fullName
     *
     * @param string $fullName
     *
     * @return MarketingStaffEntity
     */
    public function setFullName($fullName)
    {
        $this->fullName = $fullName;

        return $this;
    }

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

    /**
     * Set gender
     *
     * @param string $gender
     *
     * @return MarketingStaffEntity
     */
    public function setGender($gender)
    {
        $this->gender = $gender;

        return $this;
    }

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

    /**
     * Set birthDate
     *
     * @param \DateTime $birthDate
     *
     * @return MarketingStaffEntity
     */
    public function setBirthDate($birthDate)
    {
        $this->birthDate = empty($birthDate) ? NULL : new \DateTime($birthDate);

        return $this;
    }

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

    /**
     * Set address
     *
     * @param string $address
     *
     * @return MarketingStaffEntity
     */
    public function setAddress($address)
    {
        $this->address = $address;

        return $this;
    }

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

    /**
     * Set street
     *
     * @param string $street
     *
     * @return MarketingStaffEntity
     */
    public function setStreet($street)
    {
        $this->street = $street;

        return $this;
    }

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

    /**
     * Set mobileNo
     *
     * @param string $mobileNo
     *
     * @return MarketingStaffEntity
     */
    public function setMobileNo($mobileNo)
    {
        $this->mobileNo = $mobileNo;

        return $this;
    }

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

    /**
     * Set mobileNoTwo
     *
     * @param string $mobileNoTwo
     *
     * @return MarketingStaffEntity
     */
    public function setMobileNoTwo($mobileNoTwo)
    {
        $this->mobileNoTwo = $mobileNoTwo;

        return $this;
    }

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

    /**
     * Set mobileNoThree
     *
     * @param string $mobileNoThree
     *
     * @return MarketingStaffEntity
     */
    public function setMobileNoThree($mobileNoThree)
    {
        $this->mobileNoThree = $mobileNoThree;

        return $this;
    }

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

    /**
     * Set phoneNo
     *
     * @param string $phoneNo
     *
     * @return MarketingStaffEntity
     */
    public function setPhoneNo($phoneNo)
    {
        $this->phoneNo = $phoneNo;

        return $this;
    }

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

    /**
     * Set phoneNoTwo
     *
     * @param string $phoneNoTwo
     *
     * @return MarketingStaffEntity
     */
    public function setPhoneNoTwo($phoneNoTwo)
    {
        $this->phoneNoTwo = $phoneNoTwo;

        return $this;
    }

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

    /**
     * Set phoneNoThree
     *
     * @param string $phoneNoThree
     *
     * @return MarketingStaffEntity
     */
    public function setPhoneNoThree($phoneNoThree)
    {
        $this->phoneNoThree = $phoneNoThree;

        return $this;
    }

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

    /**
     * Set email
     *
     * @param string $email
     *
     * @return MarketingStaffEntity
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }

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

    /**
     * Set emailTwo
     *
     * @param string $emailTwo
     *
     * @return MarketingStaffEntity
     */
    public function setEmailTwo($emailTwo)
    {
        $this->emailTwo = $emailTwo;

        return $this;
    }

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

    /**
     * Set emailThree
     *
     * @param string $emailThree
     *
     * @return MarketingStaffEntity
     */
    public function setEmailThree($emailThree)
    {
        $this->emailThree = $emailThree;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set photoDescription
     *
     * @param string $photoDescription
     *
     * @return MarketingStaffEntity
     */
    public function setPhotoDescription($photoDescription)
    {
        $this->photoDescription = $photoDescription;

        return $this;
    }

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

    /**
     * Set parsedPhotoDescription
     *
     * @param string $parsedPhotoDescription
     *
     * @return MarketingStaffEntity
     */
    public function setParsedPhotoDescription($parsedPhotoDescription)
    {
        $this->parsedPhotoDescription = $parsedPhotoDescription;

        return $this;
    }

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

    /**
     * Set marketingStaffType
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffTypeEntity $marketingStaffType
     *
     * @return MarketingStaffEntity
     */
    public function setMarketingStaffType(\RxConnexionBundle\Entity\MarketingStaffTypeEntity $marketingStaffType = null)
    {
        $this->marketingStaffType = $marketingStaffType;

        return $this;
    }

    /**
     * Get marketingStaffType
     *
     * @return \RxConnexionBundle\Entity\MarketingStaffTypeEntity
     */
    public function getMarketingStaffType()
    {
        return $this->marketingStaffType;
    }

    /**
     * Set city
     *
     * @param \RxConnexionBundle\Entity\CityEntity $city
     *
     * @return MarketingStaffEntity
     */
    public function setCity(\RxConnexionBundle\Entity\CityEntity $city = null)
    {
        $this->city = $city;

        return $this;
    }

    /**
     * Get city
     *
     * @return \RxConnexionBundle\Entity\CityEntity
     */
    public function getCity()
    {
        return $this->city;
    }

    /**
     * Add healthFacility
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffHealthFacilityEntity $healthFacility
     *
     * @return MarketingStaffEntity
     */
    public function addHealthFacility(\RxConnexionBundle\Entity\MarketingStaffHealthFacilityEntity $healthFacility)
    {
        $this->healthFacilities[] = $healthFacility;

        return $this;
    }

    /**
     * Remove healthFacility
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffHealthFacilityEntity $healthFacility
     */
    public function removeHealthFacility(\RxConnexionBundle\Entity\MarketingStaffHealthFacilityEntity $healthFacility)
    {
        $this->healthFacilities->removeElement($healthFacility);
    }

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

    /**
     * Set postalCode
     *
     * @param \RxConnexionBundle\Entity\PostalCodeEntity $postalCode
     *
     * @return MarketingStaffEntity
     */
    public function setPostalCode(\RxConnexionBundle\Entity\PostalCodeEntity $postalCode = null)
    {
        $this->postalCode = $postalCode;

        return $this;
    }

    /**
     * Get postalCode
     *
     * @return \RxConnexionBundle\Entity\PostalCodeEntity
     */
    public function getPostalCode()
    {
        return $this->postalCode;
    }

    /**
     * Set oldSysId
     *
     * @param string $oldSysId
     *
     * @return MarketingStaffEntity
     */
    public function setOldSysId($oldSysId)
    {
        $this->oldSysId = $oldSysId;

        return $this;
    }

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

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

    /**
     * Set createdBy
     *
     * @param string $createdBy
     *
     * @return MarketingStaffEntity
     */
    public function setCreatedBy($createdBy)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

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

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     *
     * @return MarketingStaffEntity
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

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

    /**
     * Set updatedBy
     *
     * @param string $updatedBy
     *
     * @return MarketingStaffEntity
     */
    public function setUpdatedBy($updatedBy)
    {
        $this->updatedBy = $updatedBy;

        return $this;
    }

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

    /**
     * Set updatedAt
     *
     * @param \DateTime $updatedAt
     *
     * @return MarketingStaffEntity
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

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

    /**
     * Add marketingStaffWorkSchedule
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffWorkScheduleEntity $marketingStaffWorkSchedule
     *
     * @return MarketingStaffEntity
     */
    public function addMarketingStaffWorkSchedule(\RxConnexionBundle\Entity\MarketingStaffWorkScheduleEntity $marketingStaffWorkSchedule)
    {
        $this->marketingStaffWorkSchedules[] = $marketingStaffWorkSchedule;

        return $this;
    }

    /**
     * Remove marketingStaffWorkSchedule
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffWorkScheduleEntity $marketingStaffWorkSchedule
     */
    public function removeMarketingStaffWorkSchedule(\RxConnexionBundle\Entity\MarketingStaffWorkScheduleEntity $marketingStaffWorkSchedule)
    {
        $this->marketingStaffWorkSchedules->removeElement($marketingStaffWorkSchedule);
    }

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

    /**
     * Set startDate
     *
     * @param \DateTime $startDate
     *
     * @return MarketingStaffEntity
     */
    public function setStartDate($startDate)
    {
        $this->startDate = empty($startDate) ? NULL : new \DateTime($startDate);

        return $this;
    }

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

    /**
     * Set endDate
     *
     * @param \DateTime $endDate
     *
     * @return MarketingStaffEntity
     */
    public function setEndDate($endDate)
    {
        $this->endDate = empty($endDate) ? NULL : new \DateTime($endDate);

        return $this;
    }

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

    /**
     * Set isActive
     *
     * @param boolean $isActive
     *
     * @return MarketingStaffEntity
     */
    public function setIsActive($isActive)
    {
        $this->isActive = $isActive;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Add accountUser
     *
     * @param \RxConnexionBundle\Entity\AccountUserEntity $accountUser
     *
     * @return MarketingStaffEntity
     */
    public function addAccountUser(\RxConnexionBundle\Entity\AccountUserEntity $accountUser)
    {
        $this->accountUsers[] = $accountUser;

        return $this;
    }

    /**
     * Remove accountUser
     *
     * @param \RxConnexionBundle\Entity\AccountUserEntity $accountUser
     */
    public function removeAccountUser(\RxConnexionBundle\Entity\AccountUserEntity $accountUser)
    {
        $this->accountUsers->removeElement($accountUser);
    }

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

    /**
     * Set patient
     *
     * @param \RxConnexionBundle\Entity\PatientEntity $patient
     *
     * @return MarketingStaffEntity
     */
    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;
    }

    /**
     * Set primaryPatientChart
     *
     * @param \RxConnexionBundle\Entity\PatientChartEntity $primaryPatientChart
     *
     * @return MarketingStaffEntity
     */
    public function setPrimaryPatientChart(\RxConnexionBundle\Entity\PatientChartEntity $primaryPatientChart = null)
    {
        $this->primaryPatientChart = $primaryPatientChart;

        return $this;
    }

    /**
     * Get primaryPatientChart
     *
     * @return \RxConnexionBundle\Entity\PatientChartEntity
     */
    public function getPrimaryPatientChart()
    {
        return $this->primaryPatientChart;
    }

    /**
     * Add primaryPatientChart
     *
     * @param \RxConnexionBundle\Entity\PatientChartEntity $primaryPatientChart
     *
     * @return MarketingStaffEntity
     */
    public function addPrimaryPatientChart(\RxConnexionBundle\Entity\PatientChartEntity $primaryPatientChart)
    {
        $this->primaryPatientCharts[] = $primaryPatientChart;

        return $this;
    }

    /**
     * Remove primaryPatientChart
     *
     * @param \RxConnexionBundle\Entity\PatientChartEntity $primaryPatientChart
     */
    public function removePrimaryPatientChart(\RxConnexionBundle\Entity\PatientChartEntity $primaryPatientChart)
    {
        $this->primaryPatientCharts->removeElement($primaryPatientChart);
    }

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

    /**
     * Add patientPrimaryMarketingStaff
     *
     * @param \RxConnexionBundle\Entity\PatientEntity $patientPrimaryMarketingStaff
     *
     * @return MarketingStaffEntity
     */
    public function addPatientPrimaryMarketingStaff(\RxConnexionBundle\Entity\PatientEntity $patientPrimaryMarketingStaff)
    {
        $this->patientPrimaryMarketingStaffs[] = $patientPrimaryMarketingStaff;

        return $this;
    }

    /**
     * Remove patientPrimaryMarketingStaff
     *
     * @param \RxConnexionBundle\Entity\PatientEntity $patientPrimaryMarketingStaff
     */
    public function removePatientPrimaryMarketingStaff(\RxConnexionBundle\Entity\PatientEntity $patientPrimaryMarketingStaff)
    {
        $this->patientPrimaryMarketingStaffs->removeElement($patientPrimaryMarketingStaff);
    }

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

    /**
     * Set emergencyContactName
     *
     * @param string $emergencyContactName
     *
     * @return MarketingStaffEntity
     */
    public function setEmergencyContactName($emergencyContactName)
    {
        $this->emergencyContactName = $emergencyContactName;

        return $this;
    }

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

    /**
     * Set emergencyContactNo
     *
     * @param string $emergencyContactNo
     *
     * @return MarketingStaffEntity
     */
    public function setEmergencyContactNo($emergencyContactNo)
    {
        $this->emergencyContactNo = $emergencyContactNo;

        return $this;
    }

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

    /**
     * Add marketingStaffSchedule
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleEntity $marketingStaffSchedule
     *
     * @return MarketingStaffEntity
     */
    public function addMarketingStaffSchedule(\RxConnexionBundle\Entity\MarketingStaffScheduleEntity $marketingStaffSchedule)
    {
        $this->marketingStaffSchedules[] = $marketingStaffSchedule;

        return $this;
    }

    /**
     * Remove marketingStaffSchedule
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleEntity $marketingStaffSchedule
     */
    public function removeMarketingStaffSchedule(\RxConnexionBundle\Entity\MarketingStaffScheduleEntity $marketingStaffSchedule)
    {
        $this->marketingStaffSchedules->removeElement($marketingStaffSchedule);
    }

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

    /**
     * Add marketingStaffSchedulesQueued
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffSchedulesQueued
     *
     * @return MarketingStaffEntity
     */
    public function addMarketingStaffSchedulesQueued(\RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffSchedulesQueued)
    {
        $this->marketingStaffSchedulesQueued[] = $marketingStaffSchedulesQueued;

        return $this;
    }

    /**
     * Remove marketingStaffSchedulesQueued
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffSchedulesQueued
     */
    public function removeMarketingStaffSchedulesQueued(\RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffSchedulesQueued)
    {
        $this->marketingStaffSchedulesQueued->removeElement($marketingStaffSchedulesQueued);
    }

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

    /**
     * Add marketingStaffScheduleRequest
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleRequestEntity $marketingStaffScheduleRequest
     *
     * @return MarketingStaffEntity
     */
    public function addMarketingStaffScheduleRequest(\RxConnexionBundle\Entity\MarketingStaffScheduleRequestEntity $marketingStaffScheduleRequest)
    {
        $this->marketingStaffScheduleRequests[] = $marketingStaffScheduleRequest;

        return $this;
    }

    /**
     * Remove marketingStaffScheduleRequest
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleRequestEntity $marketingStaffScheduleRequest
     */
    public function removeMarketingStaffScheduleRequest(\RxConnexionBundle\Entity\MarketingStaffScheduleRequestEntity $marketingStaffScheduleRequest)
    {
        $this->marketingStaffScheduleRequests->removeElement($marketingStaffScheduleRequest);
    }

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

    /**
     * Add referringProviderChart
     *
     * @param \RxConnexionBundle\Entity\ReferringProviderChartEntity $referringProviderChart
     *
     * @return MarketingStaffEntity
     */
    public function addReferringProviderChart(\RxConnexionBundle\Entity\ReferringProviderChartEntity $referringProviderChart)
    {
        $this->referringProviderCharts[] = $referringProviderChart;

        return $this;
    }

    /**
     * Remove referringProviderChart
     *
     * @param \RxConnexionBundle\Entity\ReferringProviderChartEntity $referringProviderChart
     */
    public function removeReferringProviderChart(\RxConnexionBundle\Entity\ReferringProviderChartEntity $referringProviderChart)
    {
        $this->referringProviderCharts->removeElement($referringProviderChart);
    }

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

    /**
     * Add referringHealthFacilityChart
     *
     * @param \RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacilityChart
     *
     * @return MarketingStaffEntity
     */
    public function addReferringHealthFacilityChart(\RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacilityChart)
    {
        $this->referringHealthFacilityCharts[] = $referringHealthFacilityChart;

        return $this;
    }

    /**
     * Remove referringHealthFacilityChart
     *
     * @param \RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacilityChart
     */
    public function removeReferringHealthFacilityChart(\RxConnexionBundle\Entity\ReferringHealthFacilityChartEntity $referringHealthFacilityChart)
    {
        $this->referringHealthFacilityCharts->removeElement($referringHealthFacilityChart);
    }

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