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

class MarketingStaffScheduleQueuedStatusEntity extends BaseEntity
{
    /**
     * @ORM\Column(type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $code;

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

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

    /**
     * @ORM\ManyToOne(targetEntity="AccountEntity", inversedBy="marketingStaffScheduleQueuedStatuses")
     * @ORM\JoinColumn(name="account_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $account;

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

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

    public function __construct()
    {
        $this->marketingStaffSchedulesQueued = new ArrayCollection();
    }


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

    /**
     * Get accountAndDescription
     *
     * @return string
     */
    public function getAccountAndDescription() {

        return ($this->account ? $this->account->getIdAndDescription() . ' | ' : '') . $this->description;
    }

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


    /**
     * Set code
     *
     * @param string $code
     *
     * @return MarketingStaffScheduleQueuedStatusEntity
     */
    public function setCode($code)
    {
        $this->code = $code;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set account
     *
     * @param \RxConnexionBundle\Entity\AccountEntity $account
     *
     * @return MarketingStaffScheduleQueuedStatusEntity
     */
    public function setAccount(\RxConnexionBundle\Entity\AccountEntity $account = null)
    {
        $this->account = $account;

        return $this;
    }

    /**
     * Get account
     *
     * @return \RxConnexionBundle\Entity\AccountEntity
     */
    public function getAccount()
    {
        return $this->account;
    }

    /**
     * Add marketingStaffSchedulesQueued
     *
     * @param \RxConnexionBundle\Entity\MarketingStaffScheduleQueuedEntity $marketingStaffSchedulesQueued
     *
     * @return MarketingStaffScheduleQueuedStatusEntity
     */
    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;
    }
}
