<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use RxConnexionBundle\Entity\Base\BaseEntity;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\MaxDepth;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\ChartTypeGroupRepository")
 * @ORM\Table(name="chart_type_group")
 */

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

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

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

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

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

    /**
     * @ORM\OneToMany(targetEntity="ChartTypeEntity", mappedBy="chartTypeGroup")
     */
    protected $chartTypes;


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

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

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

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

    /**
     * Set code
     *
     * @param string $code
     *
     * @return ChartTypeGroupEntity
     */
    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 ChartTypeGroupEntity
     */
    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 ChartTypeGroupEntity
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

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

    /**
     * Add chartType
     *
     * @param \RxConnexionBundle\Entity\ChartTypeEntity $chartType
     *
     * @return ChartTypeGroupEntity
     */
    public function addChartType(\RxConnexionBundle\Entity\ChartTypeEntity $chartType)
    {
        $this->chartTypes[] = $chartType;

        return $this;
    }

    /**
     * Remove chartType
     *
     * @param \RxConnexionBundle\Entity\ChartTypeEntity $chartType
     */
    public function removeChartType(\RxConnexionBundle\Entity\ChartTypeEntity $chartType)
    {
        $this->chartTypes->removeElement($chartType);
    }

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

    /**
     * Set ordinal
     *
     * @param string $ordinal
     *
     * @return ChartTypeGroupEntity
     */
    public function setOrdinal($ordinal)
    {
        $this->ordinal = $ordinal;

        return $this;
    }

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

    /**
     * Set expectedNoOfDays
     *
     * @param string $expectedNoOfDays
     *
     * @return ChartTypeGroupEntity
     */
    public function setExpectedNoOfDays($expectedNoOfDays)
    {
        $this->expectedNoOfDays = $expectedNoOfDays;

        return $this;
    }

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