Files
kimai/src/Entity/Activity.php
Kevin Papst 98dc38ed99 timesheet export (#317)
* remove autocomplete for begin and end
* fix minute display in timesheet-edit form
* toolbar form label in separate row
* added export action
2018-09-24 16:46:10 +02:00

226 lines
4.0 KiB
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* 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;
/**
* Activity
*
* @ORM\Table(name="activities")
* @ORM\Entity(repositoryClass="App\Repository\ActivityRepository")
*/
class Activity
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var Project
*
* @ORM\ManyToOne(targetEntity="App\Entity\Project", inversedBy="activities")
* @ORM\JoinColumn(onDelete="CASCADE")
* @Assert\NotNull()
*/
private $project;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
* @Assert\NotBlank()
* @Assert\Length(min=2, max=255)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
*/
private $comment;
/**
* @var bool
*
* @ORM\Column(name="visible", type="boolean", nullable=false)
* @Assert\NotNull()
*/
private $visible = true;
/**
* @var Timesheet[]
*
* @ORM\OneToMany(targetEntity="App\Entity\Timesheet", mappedBy="activity")
*/
private $timesheets;
/**
* @var float
*
* @ORM\Column(name="fixed_rate", type="decimal", precision=10, scale=2, nullable=true)
* @Assert\GreaterThanOrEqual(0)
*/
private $fixedRate = null;
/**
* @var float
*
* @ORM\Column(name="hourly_rate", type="decimal", precision=10, scale=2, nullable=true)
* @Assert\GreaterThanOrEqual(0)
*/
private $hourlyRate = null;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return Timesheet[]
*/
public function getTimesheets(): array
{
return $this->timesheets;
}
/**
* @return Project
*/
public function getProject()
{
return $this->project;
}
/**
* @param Project $project
* @return Activity
*/
public function setProject($project)
{
$this->project = $project;
return $this;
}
/**
* @param string $name
* @return Activity
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $comment
* @return Activity
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* @param bool $visible
* @return Activity
*/
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
/**
* @return bool
*/
public function getVisible()
{
return $this->visible;
}
/**
* @return float
*/
public function getFixedRate(): ?float
{
return $this->fixedRate;
}
/**
* @param float $fixedRate
* @return Activity
*/
public function setFixedRate(?float $fixedRate)
{
$this->fixedRate = $fixedRate;
return $this;
}
/**
* @return float
*/
public function getHourlyRate(): ?float
{
return $this->hourlyRate;
}
/**
* @param float $hourlyRate
* @return Activity
*/
public function setHourlyRate(?float $hourlyRate)
{
$this->hourlyRate = $hourlyRate;
return $this;
}
/**
* @return string
*/
public function __toString()
{
return $this->getName();
}
}