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,8 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use Doctrine\DBAL\Types\Types;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\AbstractNamedDBElement;
use Doctrine\ORM\Mapping as ORM;
@ -51,7 +53,7 @@ use Symfony\Component\Validator\Constraints as Assert;
use function sprintf;
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'type', type: 'smallint')]
#[ORM\DiscriminatorMap([0 => 'CategoryParameter', 1 => 'CurrencyParameter', 2 => 'ProjectParameter', 3 => 'FootprintParameter', 4 => 'GroupParameter', 5 => 'ManufacturerParameter', 6 => 'MeasurementUnitParameter', 7 => 'PartParameter', 8 => 'StorelocationParameter', 9 => 'SupplierParameter', 10 => 'AttachmentTypeParameter'])]
@ -71,7 +73,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
*/
#[Assert\Length(max: 20)]
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $symbol = '';
/**
@ -81,7 +83,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
#[Assert\LessThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.min_lesser_typical')]
#[Assert\LessThan(propertyPath: 'value_max', message: 'parameters.validator.min_lesser_max')]
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, nullable: true)]
#[ORM\Column(type: Types::FLOAT, nullable: true)]
protected ?float $value_min = null;
/**
@ -89,7 +91,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
*/
#[Assert\Type([null, 'float'])]
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, nullable: true)]
#[ORM\Column(type: Types::FLOAT, nullable: true)]
protected ?float $value_typical = null;
/**
@ -98,21 +100,21 @@ abstract class AbstractParameter extends AbstractNamedDBElement
#[Assert\Type(['float', null])]
#[Assert\GreaterThanOrEqual(propertyPath: 'value_typical', message: 'parameters.validator.max_greater_typical')]
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, nullable: true)]
#[ORM\Column(type: Types::FLOAT, nullable: true)]
protected ?float $value_max = null;
/**
* @var string The unit in which the value values are given (e.g. V)
*/
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $unit = '';
/**
* @var string a text value for the given property
*/
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)]
#[ORM\Column(type: Types::STRING)]
protected string $value_text = '';
/**
@ -120,7 +122,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
*/
#[Groups(['full'])]
#[Groups(['full'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, name: 'param_group')]
#[ORM\Column(type: Types::STRING, name: 'param_group')]
protected string $group = '';
/**

View file

@ -41,20 +41,21 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Base\AbstractDBElement;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class AttachmentTypeParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = AttachmentType::class;
/**
* @var AttachmentType the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Attachments\AttachmentType::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,20 +41,21 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Category;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class CategoryParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Category::class;
/**
* @var Category the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Category::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,6 +41,7 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\PriceInformations\Currency;
use Doctrine\ORM\Mapping as ORM;
@ -50,7 +51,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
* An attachment attached to a category element.
*/
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class CurrencyParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Currency::class;
@ -58,7 +59,7 @@ class CurrencyParameter extends AbstractParameter
/**
* @var Currency the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\PriceInformations\Currency::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Currency::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Footprint;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class FootprintParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Footprint::class;
@ -55,7 +56,7 @@ class FootprintParameter extends AbstractParameter
/**
* @var Footprint the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Footprint::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Footprint::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\UserSystem\Group;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class GroupParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Group::class;
@ -55,7 +56,7 @@ class GroupParameter extends AbstractParameter
/**
* @var Group the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\UserSystem\Group::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Group::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Manufacturer;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class ManufacturerParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Manufacturer::class;
@ -55,7 +56,7 @@ class ManufacturerParameter extends AbstractParameter
/**
* @var Manufacturer the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Manufacturer::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Manufacturer::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\MeasurementUnit;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class MeasurementUnitParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = MeasurementUnit::class;
@ -55,7 +56,7 @@ class MeasurementUnitParameter extends AbstractParameter
/**
* @var MeasurementUnit the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\MeasurementUnit::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: MeasurementUnit::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Part;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class PartParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Part::class;
@ -55,7 +56,7 @@ class PartParameter extends AbstractParameter
/**
* @var Part the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Part::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Part::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\ProjectSystem\Project;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class ProjectParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Project::class;
@ -55,7 +56,7 @@ class ProjectParameter extends AbstractParameter
/**
* @var Project the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\ProjectSystem\Project::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Project::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Storelocation;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class StorelocationParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Storelocation::class;
@ -55,7 +56,7 @@ class StorelocationParameter extends AbstractParameter
/**
* @var Storelocation the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Storelocation::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Storelocation::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}

View file

@ -41,13 +41,14 @@ declare(strict_types=1);
namespace App\Entity\Parameters;
use App\Repository\ParameterRepository;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Parts\Supplier;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[UniqueEntity(fields: ['name', 'group', 'element'])]
#[ORM\Entity(repositoryClass: \App\Repository\ParameterRepository::class)]
#[ORM\Entity(repositoryClass: ParameterRepository::class)]
class SupplierParameter extends AbstractParameter
{
final public const ALLOWED_ELEMENT_CLASS = Supplier::class;
@ -55,7 +56,7 @@ class SupplierParameter extends AbstractParameter
/**
* @var Supplier the element this para is associated with
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\Parts\Supplier::class, inversedBy: 'parameters')]
#[ORM\ManyToOne(targetEntity: Supplier::class, inversedBy: 'parameters')]
#[ORM\JoinColumn(name: 'element_id', nullable: false, onDelete: 'CASCADE')]
protected ?AbstractDBElement $element = null;
}