<?php

namespace VGM\WOBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * WorkType
 */
class WorkType
{
    /**
     * @var integer
     */
    private $id;
    /**
     * @var string
     */
    private $work_type;
    /**
     * @var \DateTime
     */
    private $created_at;
    /**
     * @var \DateTime
     */
    private $updated_at;
    /**
     * @var string
     */
    private $description;
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $workorders;
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $ws_associations;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->workorders = new \Doctrine\Common\Collections\ArrayCollection();
    }
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set work_type
     *
     * @param string $workType
     * @return WorkType
     */
    public function setWorkType($workType)
    {
        $this->work_type = $workType;

        return $this;
    }
    /**
     * Get work_type
     *
     * @return string 
     */
    public function getWorkType()
    {
        return $this->work_type;
    }
    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return WorkType
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }
    /**
     * Get created_at
     *
     * @return \DateTime 
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }
    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return WorkType
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }
    /**
     * Get updated_at
     *
     * @return \DateTime 
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }
    /**
     * Set description
     *
     * @param string $description
     * @return WorkType
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }
    /**
     * Get description
     *
     * @return string 
     */
    public function getDescription()
    {
        return $this->description;
    }
    /**
     * Add workorders
     *
     * @param \VGM\WOBundle\Entity\WorkOrder $workorders
     * @return WorkType
     */
    public function addWorkorder(\VGM\WOBundle\Entity\WorkOrder $workorders)
    {
        $this->workorders[] = $workorders;

        return $this;
    }
    /**
     * Remove workorders
     *
     * @param \VGM\WOBundle\Entity\WorkOrder $workorders
     */
    public function removeWorkorder(\VGM\WOBundle\Entity\WorkOrder $workorders)
    {
        $this->workorders->removeElement($workorders);
    }
    /**
     * Get workorders
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getWorkorders()
    {
        return $this->workorders;
    }
    /**
     * Add wsAssociation
     *
     * @param \VGM\WOBundle\Entity\WorkOrderStockAssociation $wsAssociation
     *
     * @return WorkType
     */
    public function addWsAssociation(\VGM\WOBundle\Entity\WorkOrderStockAssociation $wsAssociation)
    {
        $this->ws_associations[] = $wsAssociation;

        return $this;
    }
    /**
     * Remove wsAssociation
     *
     * @param \VGM\WOBundle\Entity\WorkOrderStockAssociation $wsAssociation
     */
    public function removeWsAssociation(\VGM\WOBundle\Entity\WorkOrderStockAssociation $wsAssociation)
    {
        $this->ws_associations->removeElement($wsAssociation);
    }
    /**
     * Get wsAssociations
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getWsAssociations()
    {
        return $this->ws_associations;
    }

    /**
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        $this->setCreatedAt(new \DateTime());

        return $this;
    }
    /**
     * @ORM\PrePersist
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        $this->setUpdatedAt(new \DateTime());

        return $this;
    }

    public function __toString(){
        return $this->getWorkType();
    }
}
