monthly budget, monthly report, unified report calculation (#2684)

This commit is contained in:
Kevin Papst
2021-08-06 18:38:41 +02:00
committed by GitHub
parent 21f785638c
commit cefd747e91
196 changed files with 5031 additions and 2167 deletions

View File

@@ -14,14 +14,11 @@ use Doctrine\ORM\EntityManagerInterface;
final class ActivityLoader implements LoaderInterface
{
/**
* @var ActivityIdLoader
*/
private $loader;
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->loader = new ActivityIdLoader($entityManager);
$this->entityManager = $entityManager;
}
/**
@@ -33,6 +30,7 @@ final class ActivityLoader implements LoaderInterface
return $activity->getId();
}, $activities);
$this->loader->loadResults($ids);
$loader = new ActivityIdLoader($this->entityManager);
$loader->loadResults($ids);
}
}

View File

@@ -14,14 +14,11 @@ use Doctrine\ORM\EntityManagerInterface;
final class CustomerLoader implements LoaderInterface
{
/**
* @var CustomerIdLoader
*/
private $loader;
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->loader = new CustomerIdLoader($entityManager);
$this->entityManager = $entityManager;
}
/**
@@ -33,6 +30,7 @@ final class CustomerLoader implements LoaderInterface
return $customer->getId();
}, $customers);
$this->loader->loadResults($ids);
$loader = new CustomerIdLoader($this->entityManager);
$loader->loadResults($ids);
}
}

View File

@@ -14,14 +14,11 @@ use Doctrine\ORM\EntityManagerInterface;
final class InvoiceLoader implements LoaderInterface
{
/**
* @var InvoiceIdLoader
*/
private $loader;
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->loader = new InvoiceIdLoader($entityManager);
$this->entityManager = $entityManager;
}
/**
@@ -33,6 +30,7 @@ final class InvoiceLoader implements LoaderInterface
return $invoice->getId();
}, $invoices);
$this->loader->loadResults($ids);
$loader = new InvoiceIdLoader($this->entityManager);
$loader->loadResults($ids);
}
}

View File

@@ -14,14 +14,11 @@ use Doctrine\ORM\EntityManagerInterface;
final class ProjectLoader implements LoaderInterface
{
/**
* @var ProjectIdLoader
*/
private $loader;
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->loader = new ProjectIdLoader($entityManager);
$this->entityManager = $entityManager;
}
/**
@@ -33,6 +30,7 @@ final class ProjectLoader implements LoaderInterface
return $project->getId();
}, $projects);
$this->loader->loadResults($ids);
$loader = new ProjectIdLoader($this->entityManager);
$loader->loadResults($ids);
}
}

View File

@@ -45,5 +45,13 @@ final class TeamIdLoader implements LoaderInterface
->andWhere($qb->expr()->in('t.id', $ids))
->getQuery()
->execute();
$qb = $em->createQueryBuilder();
$qb->select('PARTIAL t.{id}', 'projects')
->from(Team::class, 't')
->leftJoin('t.projects', 'projects')
->andWhere($qb->expr()->in('t.id', $ids))
->getQuery()
->execute();
}
}

View File

@@ -14,14 +14,11 @@ use Doctrine\ORM\EntityManagerInterface;
final class TeamLoader implements LoaderInterface
{
/**
* @var TeamIdLoader
*/
private $loader;
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->loader = new TeamIdLoader($entityManager);
$this->entityManager = $entityManager;
}
/**
@@ -33,6 +30,7 @@ final class TeamLoader implements LoaderInterface
return $team->getId();
}, $teams);
$this->loader->loadResults($ids);
$loader = new TeamIdLoader($this->entityManager);
$loader->loadResults($ids);
}
}

View File

@@ -14,14 +14,13 @@ use Doctrine\ORM\EntityManagerInterface;
final class TimesheetLoader implements LoaderInterface
{
/**
* @var TimesheetIdLoader
*/
private $loader;
private $entityManager;
private $hydrateFullTree;
public function __construct(EntityManagerInterface $entityManager, bool $hydrateFullTree = false)
{
$this->loader = new TimesheetIdLoader($entityManager, $hydrateFullTree);
$this->entityManager = $entityManager;
$this->hydrateFullTree = $hydrateFullTree;
}
/**
@@ -33,6 +32,7 @@ final class TimesheetLoader implements LoaderInterface
return $timesheet->getId();
}, $timesheets);
$this->loader->loadResults($ids);
$loader = new TimesheetIdLoader($this->entityManager, $this->hydrateFullTree);
$loader->loadResults($ids);
}
}

View File

@@ -14,14 +14,11 @@ use Doctrine\ORM\EntityManagerInterface;
final class UserLoader implements LoaderInterface
{
/**
* @var UserIdLoader
*/
private $loader;
private $entityManager;
public function __construct(EntityManagerInterface $entityManager)
{
$this->loader = new UserIdLoader($entityManager);
$this->entityManager = $entityManager;
}
/**
@@ -33,6 +30,7 @@ final class UserLoader implements LoaderInterface
return $user->getId();
}, $users);
$this->loader->loadResults($ids);
$loader = new UserIdLoader($this->entityManager);
$loader->loadResults($ids);
}
}