mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 19:34:31 +02:00
Add a reference to the used info provider to a part
This commit is contained in:
parent
db97114fb4
commit
a95ba1acc4
11 changed files with 481 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue