Add a reference to the used info provider to a part

This commit is contained in:
Jan Böhmer 2023-07-16 01:24:49 +02:00
parent db97114fb4
commit a95ba1acc4
11 changed files with 481 additions and 0 deletions

View file

@ -22,6 +22,7 @@ declare(strict_types=1);
namespace App\Entity\Parts\PartTraits;
use App\Entity\Parts\InfoProviderReference;
use Doctrine\DBAL\Types\Types;
use App\Entity\Parts\Part;
use Doctrine\ORM\Mapping as ORM;
@ -63,6 +64,12 @@ trait AdvancedPropertyTrait
#[ORM\Column(type: Types::STRING, length: 100, nullable: true, unique: true)]
protected ?string $ipn = null;
/**
* @var InfoProviderReference The reference to the info provider, that provided the information about this part
*/
#[ORM\Embedded(class: InfoProviderReference::class, columnPrefix: 'provider_reference_')]
protected InfoProviderReference $providerReference;
/**
* Checks if this part is marked, for that it needs further review.
*/
@ -150,5 +157,27 @@ trait AdvancedPropertyTrait
return $this;
}
/**
* Returns the reference to the info provider, that provided the information about this part.
* @return InfoProviderReference
*/
public function getProviderReference(): InfoProviderReference
{
return $this->providerReference;
}
/**
* Sets the reference to the info provider, that provided the information about this part.
* @param InfoProviderReference $providerReference
* @return AdvancedPropertyTrait
*/
public function setProviderReference(InfoProviderReference $providerReference): self
{
$this->providerReference = $providerReference;
return $this;
}
}