Files
kimai2/src/Entity/Project.php

236 lines
3.9 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;
/**
* Project
*
* @ORM\Table(name="projects")
* @ORM\Entity(repositoryClass="App\Repository\ProjectRepository")
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class Project
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var Customer
*
* @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="projects")
* @ORM\JoinColumn(onDelete="CASCADE")
* @Assert\NotNull()
*/
private $customer;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
* @Assert\NotNull()
* @Assert\Length(min=2, max=255)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
*/
private $comment;
/**
* @var boolean
*
* @ORM\Column(name="visible", type="boolean", nullable=false)
* @Assert\NotNull()
*/
private $visible = true;
/**
* @var string
*
* @ORM\Column(name="budget", type="decimal", precision=10, scale=2, nullable=false)
* @Assert\NotNull()
*/
private $budget = 0.00;
/**
* @var Activity[]
*
* @ORM\OneToMany(targetEntity="App\Entity\Activity", mappedBy="project")
*/
private $activities;
/**
* Get projectid
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* @return Customer
*/
public function getCustomer()
{
return $this->customer;
}
/**
* @param $customer
* @return $this
*/
public function setCustomer($customer)
{
$this->customer = $customer;
return $this;
}
/**
* Set name
*
* @param string $name
*
* @return Project
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set comment
*
* @param string $comment
*
* @return Project
*/
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 Project
*/
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
/**
* Get visible
*
* @return boolean
*/
public function getVisible()
{
return $this->visible;
}
/**
* Set budget
*
* @param string $budget
*
* @return Project
*/
public function setBudget($budget)
{
$this->budget = $budget;
return $this;
}
/**
* Get budget
*
* @return string
*/
public function getBudget()
{
return $this->budget;
}
/**
* @param Activity[] $activities
* @return $this
*/
public function setActivities($activities)
{
$this->activities = $activities;
return $this;
}
/**
* @return Activity[]
*/
public function getActivities()
{
return $this->activities;
}
/**
* @return string
*/
public function __toString()
{
return $this->getName();
}
}