<?php

namespace DMD\LaLigaApi\Service\Common;

use DMD\LaLigaApi\Dto\TeamDto;
use DMD\LaLigaApi\Entity\Team;

class TeamFactory
{
    public static function create(TeamDto $teamDto): Team
    {
        $teamEntity = new Team();
        if (!empty($teamDto->name))
        {
            $teamEntity->setName($teamDto->name);
        }
        $teamEntity->setActive(true);
        return $teamEntity;
    }
}