30 lines
774 B
PHP
30 lines
774 B
PHP
<?php
|
|
|
|
namespace DMD\LaLigaApi\Service\League;
|
|
|
|
use DMD\LaLigaApi\Dto\FacilityDto;
|
|
use DMD\LaLigaApi\Dto\LeagueDto;
|
|
use DMD\LaLigaApi\Entity\Facility;
|
|
use DMD\LaLigaApi\Entity\League;
|
|
|
|
class FacilityFactory
|
|
{
|
|
public static function create(FacilityDto $facilityDto): Facility
|
|
{
|
|
$facilityEntity = new Facility();
|
|
if (!empty($facilityDto->name))
|
|
{
|
|
$facilityEntity->setName($facilityDto->name);
|
|
}
|
|
if (!empty($facilityDto->address))
|
|
{
|
|
$facilityEntity->setName($facilityDto->address);
|
|
}
|
|
if (!empty($facilityDto->address))
|
|
{
|
|
$facilityEntity->setName($facilityDto->address);
|
|
}
|
|
$facilityEntity->setActive(true);
|
|
return $facilityEntity;
|
|
}
|
|
} |