<?php

declare(strict_types=1);

namespace Apexl\Io\Mirror\Factories;

use Apexl\Io\File\Entities\FileEntity;
use Apexl\Io\Mirror\Helpers\UploadableFileEntity;
use DI\Container;

final readonly class UploadableFileEntityFactory
{
    public function __construct(private Container $container) {}

    public function fromId(int $id): UploadableFileEntity
    {
        return $this->make(FileEntity::find($id));
    }

    public function make(FileEntity $fileEntity): UploadableFileEntity
    {
        return $this->container->make(UploadableFileEntity::class, [
            'fileEntity' => $fileEntity,
        ]);
    }
}
