20 lines
408 B
PHP
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;
|
|
}
|
|
} |