509 lines
8.5 KiB
PHP
509 lines
8.5 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Kimai package.
|
|
*
|
|
* (c) Kevin Papst <kevin@kevinpapst.de>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
/**
|
|
* Customer
|
|
*
|
|
* @ORM\Table(name="customers")
|
|
* @ORM\Entity(repositoryClass="App\Repository\CustomerRepository")
|
|
*
|
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
|
*/
|
|
class Customer
|
|
{
|
|
|
|
const DEFAULT_CURRENCY = 'EUR';
|
|
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="IDENTITY")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="name", type="string", length=255, nullable=false)
|
|
* @Assert\NotBlank()
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="number", type="string", length=50, nullable=false)
|
|
* @Assert\NotBlank()
|
|
*/
|
|
private $number;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
|
|
*/
|
|
private $comment;
|
|
|
|
/**
|
|
* @var Project[]
|
|
*
|
|
* @ORM\OneToMany(targetEntity="App\Entity\Project", mappedBy="customer")
|
|
*/
|
|
private $projects;
|
|
|
|
/**
|
|
* @var boolean
|
|
*
|
|
* @ORM\Column(name="visible", type="boolean", nullable=false)
|
|
* @Assert\NotNull()
|
|
*/
|
|
private $visible = true;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="company", type="string", length=255, nullable=true)
|
|
*/
|
|
private $company;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="contact", type="string", length=255, nullable=true)
|
|
*/
|
|
private $contact;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="address", type="text", length=65535, nullable=true)
|
|
*/
|
|
private $address;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="country", type="string", length=2, nullable=true)
|
|
* @Assert\NotBlank()
|
|
*/
|
|
private $country;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="currency", type="string", length=3, nullable=false)
|
|
* @Assert\NotBlank()
|
|
*/
|
|
private $currency = self::DEFAULT_CURRENCY;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="phone", type="string", length=255, nullable=true)
|
|
*/
|
|
private $phone;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="fax", type="string", length=255, nullable=true)
|
|
*/
|
|
private $fax;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="mobile", type="string", length=255, nullable=true)
|
|
*/
|
|
private $mobile;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="mail", type="string", length=255, nullable=true)
|
|
*/
|
|
private $mail;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="homepage", type="string", length=255, nullable=true)
|
|
*/
|
|
private $homepage;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(name="timezone", type="string", length=255, nullable=false)
|
|
* @Assert\NotBlank()
|
|
*/
|
|
private $timezone;
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Set name
|
|
*
|
|
* @param string $name
|
|
* @return Customer
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get name
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @param string $number
|
|
* @return Customer
|
|
*/
|
|
public function setNumber(string $number)
|
|
{
|
|
$this->number = $number;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getNumber(): ?string
|
|
{
|
|
return $this->number;
|
|
}
|
|
|
|
/**
|
|
* Set comment
|
|
*
|
|
* @param string $comment
|
|
* @return Customer
|
|
*/
|
|
public function setComment($comment)
|
|
{
|
|
$this->comment = $comment;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get comment
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getComment()
|
|
{
|
|
return $this->comment;
|
|
}
|
|
|
|
/**
|
|
* Set visible
|
|
*
|
|
* @param boolean $visible
|
|
* @return Customer
|
|
*/
|
|
public function setVisible($visible)
|
|
{
|
|
$this->visible = $visible;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get visible
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function getVisible()
|
|
{
|
|
return $this->visible;
|
|
}
|
|
|
|
/**
|
|
* Set company
|
|
*
|
|
* @param string $company
|
|
* @return Customer
|
|
*/
|
|
public function setCompany($company)
|
|
{
|
|
$this->company = $company;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get company
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getCompany()
|
|
{
|
|
return $this->company;
|
|
}
|
|
|
|
/**
|
|
* Set contact
|
|
*
|
|
* @param string $contact
|
|
* @return Customer
|
|
*/
|
|
public function setContact($contact)
|
|
{
|
|
$this->contact = $contact;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get contact
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getContact()
|
|
{
|
|
return $this->contact;
|
|
}
|
|
|
|
/**
|
|
* @param string $address
|
|
* @return Customer
|
|
*/
|
|
public function setAddress($address)
|
|
{
|
|
$this->address = $address;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getAddress()
|
|
{
|
|
return $this->address;
|
|
}
|
|
|
|
/**
|
|
* Set country
|
|
*
|
|
* @param string $country
|
|
* @return Customer
|
|
*/
|
|
public function setCountry($country)
|
|
{
|
|
$this->country = $country;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get country
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getCountry()
|
|
{
|
|
return $this->country;
|
|
}
|
|
|
|
/**
|
|
* @param string $currency
|
|
* @return Customer
|
|
*/
|
|
public function setCurrency($currency)
|
|
{
|
|
$this->currency = $currency;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getCurrency()
|
|
{
|
|
return $this->currency;
|
|
}
|
|
|
|
/**
|
|
* Set phone
|
|
*
|
|
* @param string $phone
|
|
* @return Customer
|
|
*/
|
|
public function setPhone($phone)
|
|
{
|
|
$this->phone = $phone;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get phone
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getPhone()
|
|
{
|
|
return $this->phone;
|
|
}
|
|
|
|
/**
|
|
* Set fax
|
|
*
|
|
* @param string $fax
|
|
* @return Customer
|
|
*/
|
|
public function setFax($fax)
|
|
{
|
|
$this->fax = $fax;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get fax
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getFax()
|
|
{
|
|
return $this->fax;
|
|
}
|
|
|
|
/**
|
|
* Set mobile
|
|
*
|
|
* @param string $mobile
|
|
* @return Customer
|
|
*/
|
|
public function setMobile($mobile)
|
|
{
|
|
$this->mobile = $mobile;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get mobile
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getMobile()
|
|
{
|
|
return $this->mobile;
|
|
}
|
|
|
|
/**
|
|
* Set mail
|
|
*
|
|
* @param string $mail
|
|
* @return Customer
|
|
*/
|
|
public function setMail($mail)
|
|
{
|
|
$this->mail = $mail;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get mail
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getMail()
|
|
{
|
|
return $this->mail;
|
|
}
|
|
|
|
/**
|
|
* Set homepage
|
|
*
|
|
* @param string $homepage
|
|
* @return Customer
|
|
*/
|
|
public function setHomepage($homepage)
|
|
{
|
|
$this->homepage = $homepage;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get homepage
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getHomepage()
|
|
{
|
|
return $this->homepage;
|
|
}
|
|
|
|
/**
|
|
* Set timezone
|
|
*
|
|
* @param string $timezone
|
|
* @return Customer
|
|
*/
|
|
public function setTimezone($timezone)
|
|
{
|
|
$this->timezone = $timezone;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get timezone
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getTimezone()
|
|
{
|
|
return $this->timezone;
|
|
}
|
|
|
|
/**
|
|
* @param Project[] $projects
|
|
* @return Customer
|
|
*/
|
|
public function setProjects($projects)
|
|
{
|
|
$this->projects = $projects;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Project[]
|
|
*/
|
|
public function getProjects()
|
|
{
|
|
return $this->projects;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function __toString()
|
|
{
|
|
return $this->getName();
|
|
}
|
|
}
|