mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Allow to generate multiple labels at once (multiple pages in 1 PDF file).
This commit is contained in:
parent
4c5820ee22
commit
e89cc4bb01
12 changed files with 389 additions and 228 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue