Files
LaLiga-BackEnd/src/Service/Common/TeamFactory.php
T
2024-05-18 02:28:01 +02:00

20 lines
408 B
PHP

<?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;
}
}