Use imports instead of FQNs

This commit is contained in:
Jan Böhmer 2023-06-11 14:55:06 +02:00
parent f63b6d7207
commit 5629215ce4
179 changed files with 792 additions and 597 deletions

View file

@ -41,6 +41,7 @@ declare(strict_types=1);
namespace App\Entity\LabelSystem;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@ -57,53 +58,53 @@ class LabelOptions
* @var float The page size of the label in mm
*/
#[Assert\Positive]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)]
#[ORM\Column(type: Types::FLOAT)]
protected float $width = 50.0;
/**
* @var float The page size of the label in mm
*/
#[Assert\Positive]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)]
#[ORM\Column(type: Types::FLOAT)]
protected float $height = 30.0;
/**
* @var string The type of the barcode that should be used in the label (e.g. 'qr')
*/
#[Assert\Choice(choices: LabelOptions::BARCODE_TYPES)]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $barcode_type = 'none';
/**
* @var string What image should be shown along the
*/
#[Assert\Choice(choices: LabelOptions::PICTURE_TYPES)]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $picture_type = 'none';
/**
* @var string
*/
#[Assert\Choice(choices: LabelOptions::SUPPORTED_ELEMENTS)]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $supported_element = 'part';
/**
* @var string any additional CSS for the label
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
#[ORM\Column(type: Types::TEXT)]
protected string $additional_css = '';
/** @var string The mode that will be used to interpret the lines
*/
#[Assert\Choice(choices: LabelOptions::LINES_MODES)]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $lines_mode = 'html';
/**
* @var string
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
#[ORM\Column(type: Types::TEXT)]
protected string $lines = '';
public function getWidth(): float

View file

@ -41,6 +41,10 @@ declare(strict_types=1);
namespace App\Entity\LabelSystem;
use App\Repository\LabelProfileRepository;
use App\EntityListeners\TreeCacheInvalidationListener;
use Doctrine\DBAL\Types\Types;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Attachments\AttachmentContainingDBElement;
use App\Entity\Attachments\LabelAttachment;
use Doctrine\Common\Collections\Collection;
@ -49,15 +53,15 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
#[UniqueEntity(['name', 'options.supported_element'])]
#[ORM\Entity(repositoryClass: \App\Repository\LabelProfileRepository::class)]
#[ORM\EntityListeners([\App\EntityListeners\TreeCacheInvalidationListener::class])]
#[ORM\Entity(repositoryClass: LabelProfileRepository::class)]
#[ORM\EntityListeners([TreeCacheInvalidationListener::class])]
#[ORM\Table(name: 'label_profiles')]
class LabelProfile extends AttachmentContainingDBElement
{
/**
* @var Collection<int, LabelAttachment>
*/
#[ORM\OneToMany(targetEntity: \App\Entity\Attachments\LabelAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: LabelAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
@ -71,18 +75,18 @@ class LabelProfile extends AttachmentContainingDBElement
/**
* @var string The comment info for this element
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
#[ORM\Column(type: Types::TEXT)]
protected string $comment = '';
/**
* @var bool determines, if this label profile should be shown in the dropdown quick menu
*/
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $show_in_dropdown = true;
public function __construct()
{
$this->attachments = new \Doctrine\Common\Collections\ArrayCollection();
$this->attachments = new ArrayCollection();
parent::__construct();
$this->options = new LabelOptions();
}