performance improvements (#927)

This commit is contained in:
Kevin Papst
2019-07-09 03:40:48 +02:00
committed by GitHub
parent eb4aa23577
commit cbf9086e10
15 changed files with 172 additions and 85 deletions

View File

@@ -15,8 +15,14 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="kimai2_customers")
* @ORM\Table(name="kimai2_customers",
* indexes={
* @ORM\Index(columns={"visible"})
* }
* )
* @ORM\Entity(repositoryClass="App\Repository\CustomerRepository")
*
* columns={"visible"} => IDX_5A9760447AB0E859 => used in customer dropdown
*/
class Customer implements EntityWithMetaFields
{
@@ -54,13 +60,6 @@ class Customer implements EntityWithMetaFields
*/
private $comment;
/**
* @var Project[]|ArrayCollection
*
* @ORM\OneToMany(targetEntity="App\Entity\Project", mappedBy="customer")
*/
private $projects;
/**
* @var bool
*
@@ -163,7 +162,6 @@ class Customer implements EntityWithMetaFields
public function __construct()
{
$this->projects = new ArrayCollection();
$this->meta = new ArrayCollection();
}
@@ -352,14 +350,6 @@ class Customer implements EntityWithMetaFields
return $this->timezone;
}
/**
* @return Collection<Project>
*/
public function getProjects(): Collection
{
return $this->projects;
}
/**
* @internal only here for symfony forms
* @return Collection|MetaTableTypeInterface[]