mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-18 08:09:34 +00:00
Anpassungen aus statischer Analyse
This commit is contained in:
parent
5b2c9cb907
commit
8abb548249
4 changed files with 2 additions and 32 deletions
|
|
@ -33,7 +33,6 @@ use Symfony\Component\Serializer\Attribute\Context;
|
||||||
* @extends Attachment<Assembly>
|
* @extends Attachment<Assembly>
|
||||||
*/
|
*/
|
||||||
#[UniqueEntity(['name', 'attachment_type', 'element'])]
|
#[UniqueEntity(['name', 'attachment_type', 'element'])]
|
||||||
#[UniqueEntity(['name', 'attachment_type', 'element'])]
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
class AssemblyAttachment extends Attachment
|
class AssemblyAttachment extends Attachment
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ class PartCustomState extends AbstractPartsContainingDBElement
|
||||||
#[Groups(['part_custom_state:read', 'part_custom_state:write'])]
|
#[Groups(['part_custom_state:read', 'part_custom_state:write'])]
|
||||||
protected ?Attachment $master_picture_attachment = null;
|
protected ?Attachment $master_picture_attachment = null;
|
||||||
|
|
||||||
/** @var Collection<int, PartCustomStateAttachment>
|
/** @var Collection<int, PartCustomStateParameter>
|
||||||
*/
|
*/
|
||||||
#[Assert\Valid]
|
#[Assert\Valid]
|
||||||
#[ORM\OneToMany(mappedBy: 'element', targetEntity: PartCustomStateParameter::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
#[ORM\OneToMany(mappedBy: 'element', targetEntity: PartCustomStateParameter::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ class LogFilterType extends AbstractType
|
||||||
LogTargetType::PART_ASSOCIATION => 'part_association.label',
|
LogTargetType::PART_ASSOCIATION => 'part_association.label',
|
||||||
LogTargetType::BULK_INFO_PROVIDER_IMPORT_JOB => 'bulk_info_provider_import_job.label',
|
LogTargetType::BULK_INFO_PROVIDER_IMPORT_JOB => 'bulk_info_provider_import_job.label',
|
||||||
LogTargetType::BULK_INFO_PROVIDER_IMPORT_JOB_PART => 'bulk_info_provider_import_job_part.label',
|
LogTargetType::BULK_INFO_PROVIDER_IMPORT_JOB_PART => 'bulk_info_provider_import_job_part.label',
|
||||||
|
LogTargetType::PART_CUSTOM_STATE => 'part_custom_state.label',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Twig;
|
|
||||||
|
|
||||||
use App\Entity\AssemblySystem\AssemblyBOMEntry;
|
|
||||||
use Twig\Extension\AbstractExtension;
|
|
||||||
use Twig\TwigFunction;
|
|
||||||
|
|
||||||
class AssemblyTwigExtension extends AbstractExtension
|
|
||||||
{
|
|
||||||
public function getFunctions(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
new TwigFunction('has_project', [$this, 'hasProject']),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param AssemblyBOMEntry[] $bomEntries
|
|
||||||
*/
|
|
||||||
public function hasProject(array $bomEntries): bool
|
|
||||||
{
|
|
||||||
foreach ($bomEntries as $entry) {
|
|
||||||
if ($entry->getProject() !== null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue