Allow to generate multiple labels at once (multiple pages in 1 PDF file).

This commit is contained in:
Jan Böhmer 2020-04-21 00:00:29 +02:00
parent 4c5820ee22
commit e89cc4bb01
12 changed files with 389 additions and 228 deletions

View file

@ -50,6 +50,22 @@ class DBElementRepository extends EntityRepository
$this->setField($element, 'id', $new_id);
}
/**
* Find all elements that match a list of IDs.
* @param array $ids
* @return AbstractDBElement[]
*/
public function getElementsFromIDArray(array $ids): array
{
$qb = $this->createQueryBuilder('element');
$q = $qb->select('element')
->where('element.id IN (?1)')
->setParameter(1, $ids)
->getQuery();
return $q->getResult();
}
protected function setField(AbstractDBElement $element, string $field, int $new_value): void
{
$reflection = new \ReflectionClass(get_class($element));