welcome back to dyb-tech
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user