Release 2.0.15 (#3970)

This commit is contained in:
Kevin Papst
2023-04-16 00:44:00 +02:00
committed by GitHub
parent ecd8ee85f3
commit 046ed313c9
42 changed files with 796 additions and 935 deletions

View File

@@ -93,6 +93,14 @@ class TimesheetQuery extends ActivityQuery implements BillableInterface
return array_values($this->users);
}
/**
* Check if there is one or more users in the query
*/
public function hasUsers(): bool
{
return $this->timesheetUser !== null || \count($this->users) > 0;
}
/**
* Limit the data exclusively to the user.
*/

View File

@@ -66,28 +66,6 @@ class TagRepository extends EntityRepository
return $this->findOneBy(['name' => $tagName]);
}
/**
* Find ids of the given tagNames separated by comma
* @param string $tagNames
* @return array
*/
public function findIdsByTagNameList(string $tagNames): array
{
$qb = $this
->createQueryBuilder('t')
->select('t.id');
$list = array_filter(array_unique(array_map('trim', explode(',', $tagNames))));
$cnt = 0;
foreach ($list as $listElem) {
$qb
->orWhere('t.name like :elem' . $cnt)
->setParameter('elem' . $cnt, '%' . $listElem . '%');
$cnt++;
}
return array_column($qb->getQuery()->getScalarResult(), 'id');
}
/**
* Find all tag names in an alphabetical order
*