mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed inspection issues
This commit is contained in:
parent
5f29ee9052
commit
de96aae9a5
36 changed files with 55 additions and 53 deletions
|
@ -106,10 +106,8 @@ class AttachmentFileController extends AbstractController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/attachment/list", name="attachment_list")
|
* @Route("/attachment/list", name="attachment_list")
|
||||||
*
|
|
||||||
* @return JsonResponse|Response
|
|
||||||
*/
|
*/
|
||||||
public function attachmentsTable(Request $request, DataTableFactory $dataTableFactory, NodesListBuilder $nodesListBuilder)
|
public function attachmentsTable(Request $request, DataTableFactory $dataTableFactory, NodesListBuilder $nodesListBuilder): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@attachments.list_attachments');
|
$this->denyAccessUnlessGranted('@attachments.list_attachments');
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,9 @@ class LogController extends AbstractController
|
||||||
/**
|
/**
|
||||||
* @Route("/", name="log_view")
|
* @Route("/", name="log_view")
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function showLogs(Request $request, DataTableFactory $dataTable)
|
public function showLogs(Request $request, DataTableFactory $dataTable): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@system.show_logs');
|
$this->denyAccessUnlessGranted('@system.show_logs');
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showCategory(Category $category, Request $request)
|
public function showCategory(Category $category, Request $request): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@categories.read');
|
$this->denyAccessUnlessGranted('@categories.read');
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showFootprint(Footprint $footprint, Request $request)
|
public function showFootprint(Footprint $footprint, Request $request): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@footprints.read');
|
$this->denyAccessUnlessGranted('@footprints.read');
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showManufacturer(Manufacturer $manufacturer, Request $request)
|
public function showManufacturer(Manufacturer $manufacturer, Request $request): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@manufacturers.read');
|
$this->denyAccessUnlessGranted('@manufacturers.read');
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showStorelocation(Storelocation $storelocation, Request $request)
|
public function showStorelocation(Storelocation $storelocation, Request $request): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@storelocations.read');
|
$this->denyAccessUnlessGranted('@storelocations.read');
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showSupplier(Supplier $supplier, Request $request)
|
public function showSupplier(Supplier $supplier, Request $request): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('@suppliers.read');
|
$this->denyAccessUnlessGranted('@suppliers.read');
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showTag(string $tag, Request $request, DataTableFactory $dataTable)
|
public function showTag(string $tag, Request $request): Response
|
||||||
{
|
{
|
||||||
$tag = trim($tag);
|
$tag = trim($tag);
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ class PartListsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
*/
|
*/
|
||||||
public function showSearch(Request $request, DataTableFactory $dataTable)
|
public function showSearch(Request $request, DataTableFactory $dataTable): Response
|
||||||
{
|
{
|
||||||
$searchFilter = $this->searchRequestToFilter($request);
|
$searchFilter = $this->searchRequestToFilter($request);
|
||||||
|
|
||||||
|
@ -331,9 +331,9 @@ class PartListsController extends AbstractController
|
||||||
/**
|
/**
|
||||||
* @Route("/parts", name="parts_show_all")
|
* @Route("/parts", name="parts_show_all")
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function showAll(Request $request, DataTableFactory $dataTable)
|
public function showAll(Request $request): Response
|
||||||
{
|
{
|
||||||
return $this->showListWithFilter($request,'parts/lists/all_list.html.twig');
|
return $this->showListWithFilter($request,'parts/lists/all_list.html.twig');
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ class UserSettingsController extends AbstractController
|
||||||
*/
|
*/
|
||||||
public function userSettings(Request $request, EntityManagerInterface $em, UserPasswordHasherInterface $passwordEncoder, GoogleAuthenticator $googleAuthenticator, BackupCodeManager $backupCodeManager, FormFactoryInterface $formFactory, UserAvatarHelper $avatarHelper)
|
public function userSettings(Request $request, EntityManagerInterface $em, UserPasswordHasherInterface $passwordEncoder, GoogleAuthenticator $googleAuthenticator, BackupCodeManager $backupCodeManager, FormFactoryInterface $formFactory, UserAvatarHelper $avatarHelper)
|
||||||
{
|
{
|
||||||
/** @var User */
|
/** @var User $user */
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
|
||||||
$page_need_reload = false;
|
$page_need_reload = false;
|
||||||
|
|
|
@ -42,7 +42,7 @@ class NumberConstraint extends AbstractConstraint
|
||||||
protected $value2;
|
protected $value2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The operator to use
|
* @var string|null The operator to use
|
||||||
*/
|
*/
|
||||||
protected ?string $operator;
|
protected ?string $operator;
|
||||||
|
|
||||||
|
|
|
@ -148,9 +148,9 @@ class PartFilter implements FilterInterface
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return BooleanConstraint|false
|
* @return BooleanConstraint
|
||||||
*/
|
*/
|
||||||
public function getFavorite()
|
public function getFavorite(): BooleanConstraint
|
||||||
{
|
{
|
||||||
return $this->favorite;
|
return $this->favorite;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ abstract class Attachment extends AbstractNamedDBElement
|
||||||
protected bool $show_in_table = false;
|
protected bool $show_in_table = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var AttachmentType
|
* @var AttachmentType|null
|
||||||
* @ORM\ManyToOne(targetEntity="AttachmentType", inversedBy="attachments_with_type")
|
* @ORM\ManyToOne(targetEntity="AttachmentType", inversedBy="attachments_with_type")
|
||||||
* @ORM\JoinColumn(name="type_id", referencedColumnName="id", nullable=false)
|
* @ORM\JoinColumn(name="type_id", referencedColumnName="id", nullable=false)
|
||||||
* @Selectable()
|
* @Selectable()
|
||||||
|
|
|
@ -35,7 +35,7 @@ class AttachmentTypeAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;
|
public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;
|
||||||
/**
|
/**
|
||||||
* @var AttachmentType the element this attachment is associated with
|
* @var AttachmentContainingDBElement|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ class CategoryAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Category::class;
|
public const ALLOWED_ELEMENT_CLASS = Category::class;
|
||||||
/**
|
/**
|
||||||
* @var Category the element this attachment is associated with
|
* @var AttachmentContainingDBElement|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ class CurrencyAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Currency::class;
|
public const ALLOWED_ELEMENT_CLASS = Currency::class;
|
||||||
/**
|
/**
|
||||||
* @var Currency the element this attachment is associated with
|
* @var Currency|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ class FootprintAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Footprint::class;
|
public const ALLOWED_ELEMENT_CLASS = Footprint::class;
|
||||||
/**
|
/**
|
||||||
* @var Footprint the element this attachment is associated with
|
* @var Footprint|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,8 +35,9 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
class GroupAttachment extends Attachment
|
class GroupAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Group::class;
|
public const ALLOWED_ELEMENT_CLASS = Group::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Group the element this attachment is associated with
|
* @var Group|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,8 +35,9 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
class ManufacturerAttachment extends Attachment
|
class ManufacturerAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;
|
public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Manufacturer the element this attachment is associated with
|
* @var Manufacturer|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,7 +37,7 @@ class MeasurementUnitAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;
|
public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;
|
||||||
/**
|
/**
|
||||||
* @var Manufacturer the element this attachment is associated with
|
* @var Manufacturer|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ProjectAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Project::class;
|
public const ALLOWED_ELEMENT_CLASS = Project::class;
|
||||||
/**
|
/**
|
||||||
* @var Project the element this attachment is associated with
|
* @var Project|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\ProjectSystem\Project", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\ProjectSystem\Project", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,8 +35,9 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
class StorelocationAttachment extends Attachment
|
class StorelocationAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Storelocation::class;
|
public const ALLOWED_ELEMENT_CLASS = Storelocation::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Storelocation the element this attachment is associated with
|
* @var Storelocation|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,8 +35,9 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
class SupplierAttachment extends Attachment
|
class SupplierAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = Supplier::class;
|
public const ALLOWED_ELEMENT_CLASS = Supplier::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Supplier the element this attachment is associated with
|
* @var Supplier|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,8 +35,9 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
class UserAttachment extends Attachment
|
class UserAttachment extends Attachment
|
||||||
{
|
{
|
||||||
public const ALLOWED_ELEMENT_CLASS = User::class;
|
public const ALLOWED_ELEMENT_CLASS = User::class;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var User the element this attachment is associated with
|
* @var User|null the element this attachment is associated with
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="attachments")
|
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="attachments")
|
||||||
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
* @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE").
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,7 +32,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||||
trait MasterAttachmentTrait
|
trait MasterAttachmentTrait
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Attachment
|
* @var Attachment|null
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\Attachment")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\Attachment")
|
||||||
* @ORM\JoinColumn(name="id_preview_attachment", referencedColumnName="id", onDelete="SET NULL", nullable=true)
|
* @ORM\JoinColumn(name="id_preview_attachment", referencedColumnName="id", onDelete="SET NULL", nullable=true)
|
||||||
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
|
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
|
||||||
|
|
|
@ -142,7 +142,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
|
||||||
self::TARGET_TYPE_LABEL_PROFILE => LabelProfile::class,
|
self::TARGET_TYPE_LABEL_PROFILE => LabelProfile::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var User The user which has caused this log entry
|
/** @var User|null The user which has caused this log entry
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", fetch="EAGER")
|
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", fetch="EAGER")
|
||||||
* @ORM\JoinColumn(name="id_user", nullable=true, onDelete="SET NULL")
|
* @ORM\JoinColumn(name="id_user", nullable=true, onDelete="SET NULL")
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -103,13 +103,13 @@ class Part extends AttachmentContainingDBElement
|
||||||
protected $attachments;
|
protected $attachments;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DateTime the date when this element was modified the last time
|
* @var DateTime|null the date when this element was modified the last time
|
||||||
* @ORM\Column(type="datetime", name="last_modified", options={"default":"CURRENT_TIMESTAMP"})
|
* @ORM\Column(type="datetime", name="last_modified", options={"default":"CURRENT_TIMESTAMP"})
|
||||||
*/
|
*/
|
||||||
protected ?DateTime $lastModified = null;
|
protected ?DateTime $lastModified = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Attachment
|
* @var Attachment|null
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\Attachment")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Attachments\Attachment")
|
||||||
* @ORM\JoinColumn(name="id_preview_attachment", referencedColumnName="id", onDelete="SET NULL", nullable=true)
|
* @ORM\JoinColumn(name="id_preview_attachment", referencedColumnName="id", onDelete="SET NULL", nullable=true)
|
||||||
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
|
* @Assert\Expression("value == null or value.isPicture()", message="part.master_attachment.must_be_picture")
|
||||||
|
|
|
@ -55,7 +55,7 @@ trait AdvancedPropertyTrait
|
||||||
protected ?float $mass = null;
|
protected ?float $mass = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The internal part number of the part
|
* @var string|null The internal part number of the part
|
||||||
* @ORM\Column(type="string", length=100, nullable=true, unique=true)
|
* @ORM\Column(type="string", length=100, nullable=true, unique=true)
|
||||||
* @Assert\Length(max="100")
|
* @Assert\Length(max="100")
|
||||||
* @Groups({"extended", "full", "import"})
|
* @Groups({"extended", "full", "import"})
|
||||||
|
|
|
@ -59,7 +59,7 @@ trait BasicPropertyTrait
|
||||||
protected bool $favorite = false;
|
protected bool $favorite = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Category The category this part belongs too (e.g. Resistors). Use tags, for more complex grouping.
|
* @var Category|null The category this part belongs too (e.g. Resistors). Use tags, for more complex grouping.
|
||||||
* Every part must have a category.
|
* Every part must have a category.
|
||||||
* @ORM\ManyToOne(targetEntity="Category")
|
* @ORM\ManyToOne(targetEntity="Category")
|
||||||
* @ORM\JoinColumn(name="id_category", referencedColumnName="id", nullable=false)
|
* @ORM\JoinColumn(name="id_category", referencedColumnName="id", nullable=false)
|
||||||
|
|
|
@ -59,7 +59,7 @@ trait ManufacturerTrait
|
||||||
protected string $manufacturer_product_number = '';
|
protected string $manufacturer_product_number = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The production status of this part. Can be one of the specified ones.
|
* @var string|null The production status of this part. Can be one of the specified ones.
|
||||||
* @ORM\Column(type="string", length=255, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
* @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
|
* @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
|
||||||
* @Groups({"extended", "full", "import"})
|
* @Groups({"extended", "full", "import"})
|
||||||
|
|
|
@ -57,7 +57,7 @@ trait OrderTrait
|
||||||
protected bool $manual_order = false;
|
protected bool $manual_order = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Orderdetail
|
* @var Orderdetail|null
|
||||||
* @ORM\OneToOne(targetEntity="App\Entity\PriceInformations\Orderdetail")
|
* @ORM\OneToOne(targetEntity="App\Entity\PriceInformations\Orderdetail")
|
||||||
* @ORM\JoinColumn(name="order_orderdetails_id", referencedColumnName="id")
|
* @ORM\JoinColumn(name="order_orderdetails_id", referencedColumnName="id")
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -82,7 +82,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
|
||||||
protected string $supplier_product_url = '';
|
protected string $supplier_product_url = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Part
|
* @var Part|null
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="orderdetails")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="orderdetails")
|
||||||
* @ORM\JoinColumn(name="part_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
|
* @ORM\JoinColumn(name="part_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
|
@ -90,7 +90,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
|
||||||
protected ?Part $part = null;
|
protected ?Part $part = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Supplier
|
* @var Supplier|null
|
||||||
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="orderdetails")
|
* @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="orderdetails")
|
||||||
* @ORM\JoinColumn(name="id_supplier", referencedColumnName="id")
|
* @ORM\JoinColumn(name="id_supplier", referencedColumnName="id")
|
||||||
* @Assert\NotNull(message="validator.orderdetail.supplier_must_not_be_null")
|
* @Assert\NotNull(message="validator.orderdetail.supplier_must_not_be_null")
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Project extends AbstractStructuralDBElement
|
||||||
protected int $order_quantity = 0;
|
protected int $order_quantity = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string The current status of the project
|
* @var string|null The current status of the project
|
||||||
* @ORM\Column(type="string", length=64, nullable=true)
|
* @ORM\Column(type="string", length=64, nullable=true)
|
||||||
* @Assert\Choice({"draft","planning","in_production","finished","archived"})
|
* @Assert\Choice({"draft","planning","in_production","finished","archived"})
|
||||||
* @Groups({"extended", "full"})
|
* @Groups({"extended", "full"})
|
||||||
|
|
|
@ -61,7 +61,7 @@ class ProjectBOMEntry extends AbstractDBElement
|
||||||
protected string $mountnames = '';
|
protected string $mountnames = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string An optional name describing this BOM entry (useful for non-part entries)
|
* @var string|null An optional name describing this BOM entry (useful for non-part entries)
|
||||||
* @ORM\Column(type="string", nullable=true)
|
* @ORM\Column(type="string", nullable=true)
|
||||||
* @Assert\Expression(
|
* @Assert\Expression(
|
||||||
* "this.getPart() !== null or this.getName() !== null",
|
* "this.getPart() !== null or this.getName() !== null",
|
||||||
|
@ -77,7 +77,7 @@ class ProjectBOMEntry extends AbstractDBElement
|
||||||
protected string $comment;
|
protected string $comment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Project
|
* @var Project|null
|
||||||
* @ORM\ManyToOne(targetEntity="Project", inversedBy="bom_entries")
|
* @ORM\ManyToOne(targetEntity="Project", inversedBy="bom_entries")
|
||||||
* @ORM\JoinColumn(name="id_device", referencedColumnName="id")
|
* @ORM\JoinColumn(name="id_device", referencedColumnName="id")
|
||||||
*/
|
*/
|
||||||
|
@ -91,7 +91,7 @@ class ProjectBOMEntry extends AbstractDBElement
|
||||||
protected ?Part $part = null;
|
protected ?Part $part = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BigDecimal The price of this non-part BOM entry
|
* @var BigDecimal|null The price of this non-part BOM entry
|
||||||
* @ORM\Column(type="big_decimal", precision=11, scale=5, nullable=true)
|
* @ORM\Column(type="big_decimal", precision=11, scale=5, nullable=true)
|
||||||
* @Assert\AtLeastOneOf({
|
* @Assert\AtLeastOneOf({
|
||||||
* @BigDecimalPositive(),
|
* @BigDecimalPositive(),
|
||||||
|
|
|
@ -43,7 +43,7 @@ final class PermissionData implements \JsonSerializable
|
||||||
public const CURRENT_SCHEMA_VERSION = 2;
|
public const CURRENT_SCHEMA_VERSION = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array This array contains the permission values for each permission
|
* @var array|null This array contains the permission values for each permission
|
||||||
* This array contains the permission values for each permission, in the form of:
|
* This array contains the permission values for each permission, in the form of:
|
||||||
* permission => [
|
* permission => [
|
||||||
* operation => value,
|
* operation => value,
|
||||||
|
|
|
@ -216,7 +216,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
||||||
protected string $name = '';
|
protected string $name = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array|null
|
||||||
* @ORM\Column(type="json")
|
* @ORM\Column(type="json")
|
||||||
*/
|
*/
|
||||||
protected ?array $settings = [];
|
protected ?array $settings = [];
|
||||||
|
|
|
@ -27,7 +27,6 @@ use App\Services\Attachments\AttachmentManager;
|
||||||
use App\Services\Attachments\AttachmentPathResolver;
|
use App\Services\Attachments\AttachmentPathResolver;
|
||||||
use App\Services\Attachments\AttachmentReverseSearch;
|
use App\Services\Attachments\AttachmentReverseSearch;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
|
||||||
use Doctrine\ORM\Event\PostRemoveEventArgs;
|
use Doctrine\ORM\Event\PostRemoveEventArgs;
|
||||||
use Doctrine\ORM\Event\PreRemoveEventArgs;
|
use Doctrine\ORM\Event\PreRemoveEventArgs;
|
||||||
use Doctrine\ORM\Event\PreUpdateEventArgs;
|
use Doctrine\ORM\Event\PreUpdateEventArgs;
|
||||||
|
|
|
@ -97,7 +97,7 @@ class EventLoggerSubscriber implements EventSubscriber
|
||||||
|
|
||||||
public function onFlush(OnFlushEventArgs $eventArgs): void
|
public function onFlush(OnFlushEventArgs $eventArgs): void
|
||||||
{
|
{
|
||||||
$em = $eventArgs->getEntityManager();
|
$em = $eventArgs->getObjectManager();
|
||||||
$uow = $em->getUnitOfWork();
|
$uow = $em->getUnitOfWork();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -156,7 +156,7 @@ class EventLoggerSubscriber implements EventSubscriber
|
||||||
|
|
||||||
public function postFlush(PostFlushEventArgs $args): void
|
public function postFlush(PostFlushEventArgs $args): void
|
||||||
{
|
{
|
||||||
$em = $args->getEntityManager();
|
$em = $args->getObjectManager();
|
||||||
$uow = $em->getUnitOfWork();
|
$uow = $em->getUnitOfWork();
|
||||||
// If the we have added any ElementCreatedLogEntries added in postPersist, we flush them here.
|
// If the we have added any ElementCreatedLogEntries added in postPersist, we flush them here.
|
||||||
$uow->computeChangeSets();
|
$uow->computeChangeSets();
|
||||||
|
|
|
@ -56,7 +56,7 @@ final class BarcodeGeneratorTest extends WebTestCase
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->services = self::$container->get(BarcodeGenerator::class);
|
$this->services = self::getContainer()->get(BarcodeGenerator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetContent(): void
|
public function testGetContent(): void
|
||||||
|
|
|
@ -61,7 +61,7 @@ class PartLotProviderTest extends WebTestCase
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
\Locale::setDefault('en');
|
\Locale::setDefault('en');
|
||||||
$this->service = self::$container->get(PartLotProvider::class);
|
$this->service = self::getContainer()->get(PartLotProvider::class);
|
||||||
$this->target = new PartLot();
|
$this->target = new PartLot();
|
||||||
$this->target->setDescription('Lot description');
|
$this->target->setDescription('Lot description');
|
||||||
$this->target->setComment('Lot comment');
|
$this->target->setComment('Lot comment');
|
||||||
|
|
|
@ -59,7 +59,7 @@ class SandboxedTwigProviderTest extends WebTestCase
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->service = self::$container->get(SandboxedTwigProvider::class);
|
$this->service = self::getContainer()->get(SandboxedTwigProvider::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function twigDataProvider(): array
|
public function twigDataProvider(): array
|
||||||
|
|
|
@ -53,7 +53,7 @@ class PermissionSchemaUpdaterTest extends WebTestCase
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->service = self::$container->get(PermissionSchemaUpdater::class);
|
$this->service = self::getContainer()->get(PermissionSchemaUpdater::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIsSchemaUpdateNeeded(): void
|
public function testIsSchemaUpdateNeeded(): void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue