<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use RxConnexionBundle\Entity\Base\BaseEntity;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\HealthFacilityRegistrationRepository")
 * @ORM\Table(name="health_facility_registration")
 */

class HealthFacilityRegistrationEntity extends BaseEntity
{
    /**
     * @ORM\Column(name="company_description", type="string", nullable=true)
     */
    protected $companyDescription;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @ORM\ManyToOne(targetEntity="HealthFacilityTypeEntity", inversedBy="healthFacilityRegistrations")
     * @ORM\JoinColumn(name="health_facility_type_id", referencedColumnName="id")
     */
    protected $healthFacilityType;

    /**
     * @ORM\ManyToOne(targetEntity="CityEntity", inversedBy="healthFacilityRegistrations")
     * @ORM\JoinColumn(name="city_id", referencedColumnName="id")
     */
    protected $city;

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        $this->createdBy = isSet($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
        $this->createdAt = new \DateTime();
        $this->updatedBy = isSet($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
        $this->updatedAt = new \DateTime();
        $this->updateAddress();
        $this->status = 'Email Confirmation';
    }

    /**
     * Set updatedAt
     *
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        $this->updatedBy = isSet($_COOKIE['username']) ? $_COOKIE['username'] : 'System';
        $this->updatedAt = new \DateTime();
        $this->updateAddress();
    }

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

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

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


    /**
     * Set companyDescription
     *
     * @param string $companyDescription
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setCompanyDescription($companyDescription)
    {
        $this->companyDescription = $companyDescription;

        return $this;
    }

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

    /**
     * Set branchDescription
     *
     * @param string $branchDescription
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setBranchDescription($branchDescription)
    {
        $this->branchDescription = $branchDescription;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set address
     *
     * @param string $address
     *
     * @return HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    public function setStreet($street)
    {
        $this->street = $street;

        return $this;
    }

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

    /**
     * Set zipCode
     *
     * @param string $zipCode
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setZipCode($zipCode)
    {
        $this->zipCode = $zipCode;

        return $this;
    }

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

    /**
     * Set mobileNo
     *
     * @param string $mobileNo
     *
     * @return HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    public function setEmailThree($emailThree)
    {
        $this->emailThree = $emailThree;

        return $this;
    }

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

    /**
     * Set website
     *
     * @param string $website
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setWebsite($website)
    {
        $this->website = $website;

        return $this;
    }

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

    /**
     * Set twitter
     *
     * @param string $twitter
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setTwitter($twitter)
    {
        $this->twitter = $twitter;

        return $this;
    }

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

    /**
     * Set facebook
     *
     * @param string $facebook
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setFacebook($facebook)
    {
        $this->facebook = $facebook;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set token
     *
     * @param string $token
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

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

    /**
     * Set healthFacilityType
     *
     * @param \RxConnexionBundle\Entity\HealthFacilityTypeEntity $healthFacilityType
     *
     * @return HealthFacilityRegistrationEntity
     */
    public function setHealthFacilityType(\RxConnexionBundle\Entity\HealthFacilityTypeEntity $healthFacilityType = null)
    {
        $this->healthFacilityType = $healthFacilityType;

        return $this;
    }

    /**
     * Get healthFacilityType
     *
     * @return \RxConnexionBundle\Entity\HealthFacilityTypeEntity
     */
    public function getHealthFacilityType()
    {
        return $this->healthFacilityType;
    }

    /**
     * Set city
     *
     * @param \RxConnexionBundle\Entity\CityEntity $city
     *
     * @return HealthFacilityRegistrationEntity
     */
    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;
    }

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

    /**
     * Set createdBy
     *
     * @param string $createdBy
     *
     * @return HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    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 HealthFacilityRegistrationEntity
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

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