Order attachments and part lots by a reasonable parameter.

This commit is contained in:
Jan Böhmer 2020-04-01 15:37:06 +02:00
parent f0a3e9b5af
commit a4802e290f
14 changed files with 15 additions and 0 deletions

View file

@ -58,6 +58,7 @@ class AttachmentType extends AbstractStructuralDBElement
/**
* @var Collection<int, AttachmentTypeAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -95,6 +95,7 @@ class Device extends AbstractPartsContainingDBElement
/**
* @var Collection<int, DeviceAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
*/
protected $attachments;

View file

@ -103,6 +103,7 @@ class Category extends AbstractPartsContainingDBElement
/**
* @var Collection<int, CategoryAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\CategoryAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -83,6 +83,7 @@ class Footprint extends AbstractPartsContainingDBElement
/**
* @var Collection<int, FootprintAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\FootprintAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -83,6 +83,7 @@ class Manufacturer extends AbstractCompany
/**
* @var Collection<int, ManufacturerAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -100,6 +100,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
/**
* @var Collection<int, MeasurementUnitAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\MeasurementUnitAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -121,6 +121,7 @@ class Part extends AttachmentContainingDBElement
* @var Collection<int, PartAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\PartAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ColumnSecurity(type="collection", prefix="attachments")
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -57,6 +57,7 @@ trait InstockTrait
* @ORM\OneToMany(targetEntity="PartLot", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ColumnSecurity(type="collection", prefix="lots")
* @ORM\OrderBy({"amount" = "DESC"})
*/
protected $partLots;

View file

@ -44,6 +44,7 @@ namespace App\Entity\Parts\PartTraits;
use App\Entity\PriceInformations\Orderdetail;
use App\Security\Annotations\ColumnSecurity;
use Doctrine\ORM\Mapping as ORM;
use function count;
use Doctrine\Common\Collections\Collection;
@ -57,6 +58,7 @@ trait OrderTrait
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ColumnSecurity(prefix="orderdetails", type="collection")
* @ORM\OrderBy({"supplier" = "ASC", "supplierpartnr" = "ASC"})
*/
protected $orderdetails;

View file

@ -94,6 +94,7 @@ class Storelocation extends AbstractPartsContainingDBElement
/** @var Collection<int, StorelocationParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid()
*/

View file

@ -111,6 +111,7 @@ class Supplier extends AbstractCompany
/**
* @var Collection<int, SupplierAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\SupplierAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -90,6 +90,7 @@ class Currency extends AbstractStructuralDBElement
/**
* @var Collection<int, CurrencyAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\CurrencyAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -83,6 +83,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
/**
* @var Collection<int, GroupAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
* @Assert\Valid()
*/
protected $attachments;

View file

@ -229,6 +229,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* @var Collection<int, UserAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\UserAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"attachment_type" = "ASC", "name" = "ASC"})
*/
protected $attachments;