<?php

namespace Src\Modules\Auth\Infrastructure\Queries;

use Src\Modules\Auth\Interfaces\Infrastructure\Queries\IFactory;
use Src\Modules\Auth\Interfaces\Infrastructure\IFactory as IInfrastructureFactory;
use Src\Modules\Auth\Interfaces\IFactory as IModuleFactory;

class Factory implements IFactory {

    private IInfrastructureFactory $infrastructureFactory;

    public function setInfrastructureFactory(IInfrastructureFactory $factory): void
    {
        $this->infrastructureFactory = $factory;
    }

    public function getInfrastructureFactory(): IInfrastructureFactory
    {
        return $this->infrastructureFactory;
    }
    
    public function createAdminsQuery(): AdminsQuery
    {
        $query = new AdminsQuery();
        $table = $this->infrastructureFactory->getModuleFactory()->getSetting(IModuleFactory::ADMINS_TABLE);
        $query->setTable($table);
        return $query;
    }

}