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

@ -22,6 +22,9 @@ declare(strict_types=1);
namespace App\Entity\Parts;
use App\Repository\Parts\SupplierRepository;
use App\Entity\PriceInformations\Orderdetail;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Attachments\SupplierAttachment;
use App\Entity\Base\AbstractCompany;
use App\Entity\Base\AbstractStructuralDBElement;
@ -38,7 +41,7 @@ use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Supplier.
*/
#[ORM\Entity(repositoryClass: \App\Repository\Parts\SupplierRepository::class)]
#[ORM\Entity(repositoryClass: SupplierRepository::class)]
#[ORM\Table('`suppliers`')]
#[ORM\Index(name: 'supplier_idx_name', columns: ['name'])]
#[ORM\Index(name: 'supplier_idx_parent_name', columns: ['parent_id', 'name'])]
@ -56,9 +59,12 @@ class Supplier extends AbstractCompany
protected ?AbstractStructuralDBElement $parent = null;
/**
* @var \Doctrine\Common\Collections\Collection<int, \App\Entity\PriceInformations\Orderdetail>|\App\Entity\PriceInformations\Orderdetail[]
* @var Collection<int, Orderdetail>|Orderdetail[]
*/
#[ORM\OneToMany(targetEntity: \App\Entity\PriceInformations\Orderdetail::class, mappedBy: 'supplier')]
/**
* @var Collection<int, Orderdetail>|Orderdetail[]
*/
#[ORM\OneToMany(targetEntity: Orderdetail::class, mappedBy: 'supplier')]
protected Collection $orderdetails;
/**
@ -66,7 +72,7 @@ class Supplier extends AbstractCompany
* Set to null, to use global base currency.
* @Selectable()
*/
#[ORM\ManyToOne(targetEntity: \App\Entity\PriceInformations\Currency::class)]
#[ORM\ManyToOne(targetEntity: Currency::class)]
#[ORM\JoinColumn(name: 'default_currency_id')]
protected ?Currency $default_currency = null;
@ -82,14 +88,14 @@ class Supplier extends AbstractCompany
* @var Collection<int, SupplierAttachment>
*/
#[Assert\Valid]
#[ORM\OneToMany(targetEntity: \App\Entity\Attachments\SupplierAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: SupplierAttachment::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['name' => 'ASC'])]
protected Collection $attachments;
/** @var Collection<int, SupplierParameter>
*/
#[Assert\Valid]
#[ORM\OneToMany(targetEntity: \App\Entity\Parameters\SupplierParameter::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: SupplierParameter::class, mappedBy: 'element', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['group' => 'ASC', 'name' => 'ASC'])]
protected Collection $parameters;
@ -128,7 +134,7 @@ class Supplier extends AbstractCompany
*/
public function setShippingCosts(?BigDecimal $shipping_costs): self
{
if (!$shipping_costs instanceof \Brick\Math\BigDecimal) {
if (!$shipping_costs instanceof BigDecimal) {
$this->shipping_costs = null;
}
@ -142,9 +148,9 @@ class Supplier extends AbstractCompany
public function __construct()
{
parent::__construct();
$this->children = new \Doctrine\Common\Collections\ArrayCollection();
$this->orderdetails = new \Doctrine\Common\Collections\ArrayCollection();
$this->attachments = new \Doctrine\Common\Collections\ArrayCollection();
$this->parameters = new \Doctrine\Common\Collections\ArrayCollection();
$this->children = new ArrayCollection();
$this->orderdetails = new ArrayCollection();
$this->attachments = new ArrayCollection();
$this->parameters = new ArrayCollection();
}
}