mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 19:58:53 +02:00
parent
f32ae8bc6c
commit
50cca40f77
9 changed files with 998 additions and 928 deletions
|
@ -21,13 +21,23 @@
|
|||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||
|
||||
class StorelocationRepository extends AbstractPartsContainingRepository
|
||||
{
|
||||
/**
|
||||
* @param Storelocation $element
|
||||
*/
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if(!$element instanceof Storelocation) {
|
||||
throw new \InvalidArgumentException('$element must be an Storelocation!');
|
||||
}
|
||||
|
||||
$qb = new QueryBuilder($this->getEntityManager());
|
||||
|
||||
$qb->select('part')
|
||||
|
@ -45,6 +55,10 @@ class StorelocationRepository extends AbstractPartsContainingRepository
|
|||
|
||||
public function getPartsCount(object $element): int
|
||||
{
|
||||
if(!$element instanceof Storelocation) {
|
||||
throw new \InvalidArgumentException('$element must be an Storelocation!');
|
||||
}
|
||||
|
||||
$qb = new QueryBuilder($this->getEntityManager());
|
||||
|
||||
$qb->select('COUNT(part.id)')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue