added API functions to save meta fields (#1063)

This commit is contained in:
Kevin Papst
2019-08-26 14:30:39 +02:00
committed by GitHub
parent ceeec7b8a6
commit 15673555a2
14 changed files with 624 additions and 68 deletions

View File

@@ -26,6 +26,26 @@ use Pagerfanta\Pagerfanta;
class ActivityRepository extends EntityRepository
{
/**
* @param mixed $id
* @param null $lockMode
* @param null $lockVersion
* @return Activity|null
*/
public function find($id, $lockMode = null, $lockVersion = null)
{
/** @var Activity|null $activity */
$activity = parent::find($id, $lockMode, $lockVersion);
if (null === $activity) {
return null;
}
$loader = new ActivityLoader($this->getEntityManager());
$loader->loadResults([$activity]);
return $activity;
}
/**
* @param Activity $activity
* @throws ORMException

View File

@@ -28,6 +28,26 @@ use Pagerfanta\Pagerfanta;
class CustomerRepository extends EntityRepository
{
/**
* @param mixed $id
* @param null $lockMode
* @param null $lockVersion
* @return Customer|null
*/
public function find($id, $lockMode = null, $lockVersion = null)
{
/** @var Customer|null $customer */
$customer = parent::find($id, $lockMode, $lockVersion);
if (null === $customer) {
return null;
}
$loader = new CustomerLoader($this->getEntityManager());
$loader->loadResults([$customer]);
return $customer;
}
/**
* @param Customer $customer
* @throws ORMException

View File

@@ -25,11 +25,28 @@ use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Pagerfanta\Pagerfanta;
/**
* Class ProjectRepository
*/
class ProjectRepository extends EntityRepository
{
/**
* @param mixed $id
* @param null $lockMode
* @param null $lockVersion
* @return Project|null
*/
public function find($id, $lockMode = null, $lockVersion = null)
{
/** @var Project|null $project */
$project = parent::find($id, $lockMode, $lockVersion);
if (null === $project) {
return null;
}
$loader = new ProjectLoader($this->getEntityManager());
$loader->loadResults([$project]);
return $project;
}
/**
* @param Project $project
* @throws ORMException

View File

@@ -22,6 +22,20 @@ use Pagerfanta\Pagerfanta;
class TeamRepository extends EntityRepository
{
public function find($id, $lockMode = null, $lockVersion = null)
{
/** @var Team|null $team */
$team = parent::find($id, $lockMode, $lockVersion);
if (null === $team) {
return null;
}
$loader = new TeamLoader($this->getEntityManager());
$loader->loadResults([$team]);
return $team;
}
/**
* @param Team $team
* @throws ORMException

View File

@@ -35,6 +35,26 @@ class TimesheetRepository extends EntityRepository
public const STATS_QUERY_ACTIVE = 'active';
public const STATS_QUERY_MONTHLY = 'monthly';
/**
* @param mixed $id
* @param null $lockMode
* @param null $lockVersion
* @return Timesheet|null
*/
public function find($id, $lockMode = null, $lockVersion = null)
{
/** @var Timesheet|null $timesheet */
$timesheet = parent::find($id, $lockMode, $lockVersion);
if (null === $timesheet) {
return null;
}
$loader = new TimesheetLoader($this->getEntityManager());
$loader->loadResults([$timesheet]);
return $timesheet;
}
/**
* @param Timesheet $timesheet
* @throws \Doctrine\ORM\ORMException