<?php

namespace VGM\WOBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use VGM\WOBundle\Utils\Utils;
/**
 * @ORM\Entity
 * @UniqueEntity(
 *     fields={"name"},
 *     errorPath="name",
 *     message="This name is already registered."
 * )
 * @ORM\HasLifecycleCallbacks
 *
 * Client
 */
class Client
{
    /**
     * @var integer
     */
    private $id;
    /**
     * @var string
     */
    private $name;
    /**
     * @var string
     */
    private $adrees;
    /**
     * @var string
     */
    private $email;
    /**
     * @var string
     */
    private $phone1;
    /**
     * @var \DateTime
     */
    private $created_at;
    /**
     * @var \DateTime
     */
    private $updated_at;
    /**
     * @var string
     */
    private $lifecycleCallbacks;
    /**
     * @var string
     */
    private $city;
    /**
     * @var string
     */
    private $state;
    /**
     * @var integer
     */
    private $zip_code;
    /**
     * @var string
     */
    private $phone2;
    /**
     * @var string
     */
    private $bill_info;
    /**
     * @var string
     */
    private $ship_info;
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $stocks_workorders_full;
    /**
     * @var boolean
     */
    private $internal = false;
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $workorders;
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $bill_invoices;
    /**
     * @var \VGM\WOBundle\Entity\Worker
     */
    private $created_by;

    /**
     * @return mixed
     */
    public function getSlug()
    {
        return Jobeet::slugify($this->getName());
    }
    /**
     * Set city
     *
     * @param string $city
     * @return Client
     */
    public function setCity($city)
    {
        $this->city = $city;

        return $this;
    }
    /**
     * Get city
     *
     * @return string
     */
    public function getCity()
    {
        return $this->city;
    }
    /**
     * Set state
     *
     * @param string $state
     * @return Client
     */
    public function setState($state)
    {
        $this->state = $state;

        return $this;
    }
    /**
     * Get state
     *
     * @return string
     */
    public function getState()
    {
        return $this->state;
    }
    /**
     * Set zip_code
     *
     * @param integer $zipCode
     * @return Client
     */
    public function setZipCode($zipCode)
    {
        $this->zip_code = $zipCode;

        return $this;
    }
    /**
     * Get zip_code
     *
     * @return integer
     */
    public function getZipCode()
    {
        return $this->zip_code;
    }
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set name
     *
     * @param string $name
     * @return Client
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }
    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Set adrees
     *
     * @param string $adrees
     * @return Client
     */
    public function setAdrees($adrees)
    {
        $this->adrees = $adrees;

        return $this;
    }
    /**
     * Get adrees
     *
     * @return string 
     */
    public function getAdrees()
    {
        return $this->adrees;
    }
    /**
     * Set email
     *
     * @param string $email
     * @return Client
     */
    public function setEmail($email)
    {
        $this->email = $email;

        return $this;
    }
    /**
     * Get email
     *
     * @return string 
     */
    public function getEmail()
    {
        return $this->email;
    }
    /**
     * Set phone1
     *
     * @param string $phone1
     * @return Client
     */
    public function setPhone1($phone1)
    {
        $this->phone1 = $phone1;

        return $this;
    }
    /**
     * Get phone1
     *
     * @return string 
     */
    public function getPhone1()
    {
        return $this->phone1;
    }
    /**
     * Set created_at
     *
     * @param \DateTime $createAt
     * @return Client
     */
    public function setCreatedAt($created_at)
    {
        $this->created_at = $created_at;

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

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

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

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

        return $this;
    }
    /**
     * Get lifecycleCallbacks
     *
     * @return string 
     */
    public function getLifecycleCallbacks()
    {
        return $this->lifecycleCallbacks;
    }
    /**
     * Set phone2
     *
     * @param string $phone2
     * @return Client
     */
    public function setPhone2($phone2)
    {
        $this->phone2 = $phone2;

        return $this;
    }
    /**
     * Get phone2
     *
     * @return string 
     */
    public function getPhone2()
    {
        return $this->phone2;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->workorders = new \Doctrine\Common\Collections\ArrayCollection();
    }
    /**
     * Add workorders
     *
     * @param \VGM\WOBundle\Entity\WorkOrder $workorders
     * @return Client
     */
    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 stocks_workorders_full
     *
     * @param \VGM\WOBundle\Entity\WorkOrderStockAssociation $stocksWorkordersFull
     * @return Client
     */
    public function addStocksWorkordersFull(\VGM\WOBundle\Entity\WorkOrderStockAssociation $stocksWorkordersFull)
    {
        $this->stocks_workorders_full[] = $stocksWorkordersFull;

        return $this;
    }
    /**
     * Remove stocks_workorders_full
     *
     * @param \VGM\WOBundle\Entity\WorkOrderStockAssociation $stocksWorkordersFull
     */
    public function removeStocksWorkordersFull(\VGM\WOBundle\Entity\WorkOrderStockAssociation $stocksWorkordersFull)
    {
        $this->stocks_workorders_full->removeElement($stocksWorkordersFull);
    }
    /**
     * Get stocks_workorders_full
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getStocksWorkordersFull()
    {
        return $this->stocks_workorders_full;
    }
    /**
     * Set int
     *
     * @param boolean $internal
     *
     * @return Client
     */
    public function setInternal($internal)
    {
        $this->internal = $internal;

        return $this;
    }
    /**
     * Get int
     *
     * @return boolean
     */
    public function getInternal()
    {
        return $this->internal;
    }
    /**
     * Set billInfo
     *
     * @param string $billInfo
     *
     * @return Client
     */
    public function setBillInfo($billInfo)
    {
        $this->bill_info = $billInfo;

        return $this;
    }
    /**
     * Get billInfo
     *
     * @return string
     */
    public function getBillInfo()
    {
        return $this->bill_info;
    }
    /**
     * Set shipInfo
     *
     * @param string $shipInfo
     *
     * @return Client
     */
    public function setShipInfo($shipInfo)
    {
        $this->ship_info = $shipInfo;

        return $this;
    }
    /**
     * Get shipInfo
     *
     * @return string
     */
    public function getShipInfo()
    {
        return $this->ship_info;
    }
    /**
     * Add billInvoice
     *
     * @param \VGM\WOBundle\Entity\InvoiceReference $billInvoice
     *
     * @return Client
     */
    public function addBillInvoice(\VGM\WOBundle\Entity\InvoiceReference $billInvoice)
    {
        $this->bill_invoices[] = $billInvoice;

        return $this;
    }
    /**
     * Remove billInvoice
     *
     * @param \VGM\WOBundle\Entity\InvoiceReference $billInvoice
     */
    public function removeBillInvoice(\VGM\WOBundle\Entity\InvoiceReference $billInvoice)
    {
        $this->bill_invoices->removeElement($billInvoice);
    }
    /**
     * Get billInvoices
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBillInvoices()
    {
        return $this->bill_invoices;
    }
    /**
     * Set createdBy
     *
     * @param \VGM\WOBundle\Entity\Worker $createdBy
     *
     * @return Client
     */
    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;
    }

    public function slug(){
        return Utils::slugify($this->getName());
    }
    public function __toString(){
        return $this->getName();
    }
}
