. */ declare(strict_types=1); namespace App\Entity\Attachments; use App\Entity\Base\AbstractNamedDBElement; use App\Entity\Base\MasterAttachmentTrait; use App\Entity\Base\AttachmentsTrait; use App\Entity\Contracts\HasAttachmentsInterface; use App\Entity\Contracts\HasMasterAttachmentInterface; use App\Repository\AttachmentContainingDBElementRepository; use Doctrine\ORM\Mapping as ORM; /** * @template AT of Attachment */ #[ORM\MappedSuperclass(repositoryClass: AttachmentContainingDBElementRepository::class)] abstract class AttachmentContainingDBElement extends AbstractNamedDBElement implements HasMasterAttachmentInterface, HasAttachmentsInterface { use MasterAttachmentTrait; use AttachmentsTrait; public function __construct() { $this->initializeAttachments(); } public function __clone() { $this->cloneAttachments(); //Parent has to be last call, as it resets the ID parent::__clone(); } }