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

class ItemBrandEntity extends BaseEntity
{

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

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

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

    /**
     * @ORM\OneToMany(targetEntity="RxConnexionBundle\Entity\ItemEntity", mappedBy="itemBrand", cascade={"remove"})
     */
    protected $items;

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

    public function __construct()
    {
    }


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

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

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

        return $this;
    }

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

    /**
     * Add item
     *
     * @param \RxConnexionBundle\Entity\ItemEntity $item
     *
     * @return ItemBrandEntity
     */
    public function addItem(\RxConnexionBundle\Entity\ItemEntity $item)
    {
        $this->items[] = $item;

        return $this;
    }

    /**
     * Remove item
     *
     * @param \RxConnexionBundle\Entity\ItemEntity $item
     */
    public function removeItem(\RxConnexionBundle\Entity\ItemEntity $item)
    {
        $this->items->removeElement($item);
    }

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