<?php

declare(strict_types=1);

namespace apexl\Io\modules\mirror\Factory;

use apexl\Io\modules\file\entities\fileEntity;
use apexl\Io\modules\mirror\Helper\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,
        ]);
    }
}
