<?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;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\PurchaseOrderBreakdownItemDeliverySerialNoRepository")
 * @ORM\Table(name="purchase_order_breakdown_item_delivery_serial_no")
 * @ORM\HasLifecycleCallbacks()
 */

class PurchaseOrderBreakdownItemDeliverySerialNoEntity extends BaseEntity
{

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

    /**
     * @ORM\ManyToOne(targetEntity="PurchaseOrderBreakdownItemDeliveryEntity", inversedBy="purchaseOrderBreakdownItemDeliverySerialNos")
     * @ORM\JoinColumn(name="purchase_order_breakdown_item_delivery_id", referencedColumnName="id")
     */
    protected $purchaseOrderBreakdownItemDelivery;

    /**
     * @ORM\OneToMany(targetEntity="RxConnexionBundle\Entity\InventorySerialNoEntity", mappedBy="purchaseOrderBreakdownItemDeliverySerialNo", cascade={"remove", "persist"}, orphanRemoval=true)
     */
    protected $inventorySerialNos;


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


    /**
     * Set serialNo
     *
     * @param string $serialNo
     *
     * @return PurchaseOrderBreakdownItemDeliverySerialNoEntity
     */
    public function setSerialNo($serialNo)
    {
        $this->serialNo = $serialNo;

        return $this;
    }

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

    /**
     * Set purchaseOrderBreakdownItemDelivery
     *
     * @param \RxConnexionBundle\Entity\PurchaseOrderBreakdownItemDeliveryEntity $purchaseOrderBreakdownItemDelivery
     *
     * @return PurchaseOrderBreakdownItemDeliverySerialNoEntity
     */
    public function setPurchaseOrderBreakdownItemDelivery(\RxConnexionBundle\Entity\PurchaseOrderBreakdownItemDeliveryEntity $purchaseOrderBreakdownItemDelivery = null)
    {
        $this->purchaseOrderBreakdownItemDelivery = $purchaseOrderBreakdownItemDelivery;

        return $this;
    }

    /**
     * Get purchaseOrderBreakdownItemDelivery
     *
     * @return \RxConnexionBundle\Entity\PurchaseOrderBreakdownItemDeliveryEntity
     */
    public function getPurchaseOrderBreakdownItemDelivery()
    {
        return $this->purchaseOrderBreakdownItemDelivery;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->inventorySerialNos = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add inventorySerialNo
     *
     * @param \RxConnexionBundle\Entity\InventorySerialNoEntity $inventorySerialNo
     *
     * @return PurchaseOrderBreakdownItemDeliverySerialNoEntity
     */
    public function addInventorySerialNo(\RxConnexionBundle\Entity\InventorySerialNoEntity $inventorySerialNo)
    {
        $this->inventorySerialNos[] = $inventorySerialNo;

        return $this;
    }

    /**
     * Remove inventorySerialNo
     *
     * @param \RxConnexionBundle\Entity\InventorySerialNoEntity $inventorySerialNo
     */
    public function removeInventorySerialNo(\RxConnexionBundle\Entity\InventorySerialNoEntity $inventorySerialNo)
    {
        $this->inventorySerialNos->removeElement($inventorySerialNo);
    }

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