DigiComp.AssetAttributes/Classes/AssetAttributeTrait.php

30 lines
672 B
PHP
Raw Normal View History

2023-02-09 13:02:22 +01:00
<?php
namespace DigiComp\AssetAttributes;
use DigiComp\AssetAttributes\Domain\Model\AssetAttribute;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
trait AssetAttributeTrait
{
/**
* @return Collection<AssetAttribute>
*/
public function getAttributes(): Collection
{
if ($this->attributes === null) {
$this->attributes = new ArrayCollection();
}
return $this->attributes;
}
/**
* @param Collection<AssetAttribute> $attributes
*/
public function setAttributes(Collection $attributes): void
{
$this->attributes = $attributes;
}
}