mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-07 03:35:27 +02:00
Fixed code style.
This commit is contained in:
parent
2853e471c4
commit
d0b1024d80
212 changed files with 495 additions and 1005 deletions
|
@ -21,12 +21,10 @@
|
|||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
|
||||
class CategoryRepository extends AbstractPartsContainingRepository
|
||||
{
|
||||
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if (!$element instanceof Category) {
|
||||
|
@ -44,4 +42,4 @@ class CategoryRepository extends AbstractPartsContainingRepository
|
|||
|
||||
return $this->getPartsCountByField($element, 'category');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,14 +21,13 @@
|
|||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
|
||||
class FootprintRepository extends AbstractPartsContainingRepository
|
||||
{
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if(!$element instanceof Footprint) {
|
||||
if (!$element instanceof Footprint) {
|
||||
throw new \InvalidArgumentException('$element must be an Footprint!');
|
||||
}
|
||||
|
||||
|
@ -37,10 +36,10 @@ class FootprintRepository extends AbstractPartsContainingRepository
|
|||
|
||||
public function getPartsCount(object $element): int
|
||||
{
|
||||
if(!$element instanceof Footprint) {
|
||||
if (!$element instanceof Footprint) {
|
||||
throw new \InvalidArgumentException('$element must be an Footprint!');
|
||||
}
|
||||
|
||||
return $this->getPartsCountByField($element, 'footprint');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,13 +20,11 @@
|
|||
|
||||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
|
||||
class ManufacturerRepository extends AbstractPartsContainingRepository
|
||||
{
|
||||
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if (!$element instanceof Manufacturer) {
|
||||
|
@ -44,4 +42,4 @@ class ManufacturerRepository extends AbstractPartsContainingRepository
|
|||
|
||||
return $this->getPartsCountByField($element, 'manufacturer');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,13 +20,11 @@
|
|||
|
||||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
|
||||
class MeasurementUnitRepository extends AbstractPartsContainingRepository
|
||||
{
|
||||
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if (!$element instanceof MeasurementUnit) {
|
||||
|
@ -44,4 +42,4 @@ class MeasurementUnitRepository extends AbstractPartsContainingRepository
|
|||
|
||||
return $this->getPartsCountByField($element, 'partUnit');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,20 +21,18 @@
|
|||
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
|
||||
* @param Storelocation $element
|
||||
*/
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if(!$element instanceof Storelocation) {
|
||||
if (!$element instanceof Storelocation) {
|
||||
throw new \InvalidArgumentException('$element must be an Storelocation!');
|
||||
}
|
||||
|
||||
|
@ -47,7 +45,7 @@ class StorelocationRepository extends AbstractPartsContainingRepository
|
|||
->setParameter(1, $element);
|
||||
|
||||
foreach ($order_by as $field => $order) {
|
||||
$qb->addOrderBy('part.' . $field, $order);
|
||||
$qb->addOrderBy('part.'.$field, $order);
|
||||
}
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
|
@ -55,7 +53,7 @@ class StorelocationRepository extends AbstractPartsContainingRepository
|
|||
|
||||
public function getPartsCount(object $element): int
|
||||
{
|
||||
if(!$element instanceof Storelocation) {
|
||||
if (!$element instanceof Storelocation) {
|
||||
throw new \InvalidArgumentException('$element must be an Storelocation!');
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ class StorelocationRepository extends AbstractPartsContainingRepository
|
|||
->where('lots.storage_location = ?1')
|
||||
->setParameter(1, $element);
|
||||
|
||||
|
||||
return (int) $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
namespace App\Repository\Parts;
|
||||
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use App\Repository\AbstractPartsContainingRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
|
@ -30,7 +29,7 @@ class SupplierRepository extends AbstractPartsContainingRepository
|
|||
{
|
||||
public function getParts(object $element, array $order_by = ['name' => 'ASC']): array
|
||||
{
|
||||
if(!$element instanceof Supplier) {
|
||||
if (!$element instanceof Supplier) {
|
||||
throw new \InvalidArgumentException('$element must be an Supplier!');
|
||||
}
|
||||
|
||||
|
@ -43,7 +42,7 @@ class SupplierRepository extends AbstractPartsContainingRepository
|
|||
->setParameter(1, $element);
|
||||
|
||||
foreach ($order_by as $field => $order) {
|
||||
$qb->addOrderBy('part.' . $field, $order);
|
||||
$qb->addOrderBy('part.'.$field, $order);
|
||||
}
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
|
@ -51,7 +50,7 @@ class SupplierRepository extends AbstractPartsContainingRepository
|
|||
|
||||
public function getPartsCount(object $element): int
|
||||
{
|
||||
if(!$element instanceof Supplier) {
|
||||
if (!$element instanceof Supplier) {
|
||||
throw new \InvalidArgumentException('$element must be an Supplier!');
|
||||
}
|
||||
|
||||
|
@ -63,7 +62,6 @@ class SupplierRepository extends AbstractPartsContainingRepository
|
|||
->where('orderdetail.supplier = ?1')
|
||||
->setParameter(1, $element);
|
||||
|
||||
|
||||
return (int) $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue