<?php

namespace VGM\WOBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 *
 * PlanningTask
 */
class PlanningTask
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $area;

    /**
     * @var string
     */
    private $obs;

    /**
     * @var \VGM\WOBundle\Entity\Worker
     */
    private $supervisor;

    /**
     * @var string
     */
    private $description;

    /**
     * @var string
     */
    private $status;

    /**
     * @var \DateTime
     */
    private $start_date;

    /**
     * @var \DateTime
     */
    private $death_line;

    /**
     * @var \DateTime
     */
    private $created_at;

    /**
     * @var \DateTime
     */
    private $updated_at;

    /**
     * @var \VGM\WOBundle\Entity\Worker
     */
    private $created_by;

    /**
     * @var \VGM\WOBundle\Entity\CUnit
     */
    private $unit;

    /**
     * @var string
     */
    private $updated_by;

    /**
     * @var float
     */
    private $etime;

    /**
     * @var float
     */
    private $rtime;

    /**
     * @var \DateTime
     */
    private $completed_at;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $workorders;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->workorders = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

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

        return $this;
    }

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

    /**
     * Set status
     *
     * @param string $status
     *
     * @return PlanningTask
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

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

    /**
     * Set startDate
     *
     * @param \DateTime $startDate
     *
     * @return PlanningTask
     */
    public function setStartDate($startDate)
    {
        $this->start_date = $startDate;

        return $this;
    }

    /**
     * Get startDate
     *
     * @return \DateTime
     */
    public function getStartDate()
    {
        return $this->start_date;
    }

    /**
     * Set deathLine
     *
     * @param \DateTime $deathLine
     *
     * @return PlanningTask
     */
    public function setDeathLine($deathLine)
    {
        $this->death_line = $deathLine;

        return $this;
    }

    /**
     * Get deathLine
     *
     * @return \DateTime
     */
    public function getDeathLine()
    {
        return $this->death_line;
    }

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     *
     * @return PlanningTask
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }

    /**
     * Get createdAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set updatedAt
     *
     * @param \DateTime $updatedAt
     *
     * @return PlanningTask
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }

    /**
     * Get updatedAt
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    /**
     * Add workorder
     *
     * @param \VGM\WOBundle\Entity\WorkOrder $workorder
     *
     * @return PlanningTask
     */
    public function addWorkorder(\VGM\WOBundle\Entity\WorkOrder $workorder)
    {
        $this->workorders[] = $workorder;

        return $this;
    }

    /**
     * Remove workorder
     *
     * @param \VGM\WOBundle\Entity\WorkOrder $workorder
     */
    public function removeWorkorder(\VGM\WOBundle\Entity\WorkOrder $workorder)
    {
        $this->workorders->removeElement($workorder);
    }

    /**
     * Get workorders
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getWorkorders()
    {
        return $this->workorders;
    }
    /**
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        $this->setCreatedAt(new \DateTime());

        return $this;
    }

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

        return $this;
    }

    /**
     * Set createdBy
     *
     * @param \VGM\WOBundle\Entity\Worker $createdBy
     *
     * @return PlanningTask
     */
    public function setCreatedBy(\VGM\WOBundle\Entity\Worker $createdBy = null)
    {
        $this->created_by = $createdBy;

        return $this;
    }

    /**
     * Get createdBy
     *
     * @return \VGM\WOBundle\Entity\Worker
     */
    public function getCreatedBy()
    {
        return $this->created_by;
    }

    /**
     * Set unit
     *
     * @param \VGM\WOBundle\Entity\CUnit $unit
     *
     * @return PlanningTask
     */
    public function setUnit(\VGM\WOBundle\Entity\CUnit $unit = null)
    {
        $this->unit = $unit;

        return $this;
    }

    /**
     * Get unit
     *
     * @return \VGM\WOBundle\Entity\CUnit
     */
    public function getUnit()
    {
        return $this->unit;
    }

    /**
     * Set updatedBy
     *
     * @param string $updatedBy
     *
     * @return PlanningTask
     */
    public function setUpdatedBy($updatedBy)
    {
        $this->updated_by = $updatedBy;

        return $this;
    }

    /**
     * Get updatedBy
     *
     * @return string
     */
    public function getUpdatedBy()
    {
        return $this->updated_by;
    }

    /**
     * Set area
     *
     * @param string $area
     *
     * @return PlanningTask
     */
    public function setArea($area)
    {
        $this->area = $area;

        return $this;
    }

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

    /**
     * Set obs
     *
     * @param string $obs
     *
     * @return PlanningTask
     */
    public function setObs($obs)
    {
        $this->obs = $obs;

        return $this;
    }

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

    /**
     * Set supervisor
     *
     * @param \VGM\WOBundle\Entity\Worker $supervisor
     *
     * @return PlanningTask
     */
    public function setSupervisor(\VGM\WOBundle\Entity\Worker $supervisor = null)
    {
        $this->supervisor = $supervisor;

        return $this;
    }

    /**
     * Get supervisor
     *
     * @return \VGM\WOBundle\Entity\Worker
     */
    public function getSupervisor()
    {
        return $this->supervisor;
    }

    /**
     * Set etime
     *
     * @param float $etime
     *
     * @return PlanningTask
     */
    public function setEtime($etime)
    {
        $this->etime = $etime;

        return $this;
    }

    /**
     * Get etime
     *
     * @return float
     */
    public function getEtime()
    {
        return $this->etime;
    }

    /**
     * Set rtime
     *
     * @param float $rtime
     *
     * @return PlanningTask
     */
    public function setRtime($rtime)
    {
        $this->rtime = $rtime;

        return $this;
    }

    /**
     * Get rtime
     *
     * @return float
     */
    public function getRtime()
    {
        return $this->rtime;
    }

    /**
     * Set completedAt
     *
     * @param \DateTime $completedAt
     *
     * @return PlanningTask
     */
    public function setCompletedAt($completedAt)
    {
        $this->completed_at = $completedAt;

        return $this;
    }

    /**
     * Get completedAt
     *
     * @return \DateTime
     */
    public function getCompletedAt()
    {
        return $this->completed_at;
    }
    /**
     * @var integer
     */
    private $order_number = 1;


    /**
     * Set orderNumber
     *
     * @param integer $orderNumber
     *
     * @return PlanningTask
     */
    public function setOrderNumber($orderNumber)
    {
        $this->order_number = $orderNumber;

        return $this;
    }

    /**
     * Get orderNumber
     *
     * @return integer
     */
    public function getOrderNumber()
    {
        return $this->order_number;
    }
}
