Compare commits
No commits in common. "551d5043c1e79faa0585edcdb837a6f500c97529" and "75e4f5f80861b2a38393aa17fb84971c2d9eb7cc" have entirely different histories.
551d5043c1
...
75e4f5f808
@ -4,12 +4,10 @@ namespace Slovocast\Domain\Entity;
|
|||||||
|
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Slovocast\Domain\Entity as EntityTrait;
|
use Slovocast\Domain\Entity as EntityTrait;
|
||||||
use Slovocast\Domain\Record as RecordTrait;
|
|
||||||
|
|
||||||
class Episode
|
class Episode
|
||||||
{
|
{
|
||||||
use EntityTrait;
|
use EntityTrait;
|
||||||
use RecordTrait;
|
|
||||||
|
|
||||||
private string $duration;
|
private string $duration;
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Slovocast\Domain\Factory;
|
|
||||||
|
|
||||||
use Slovocast\Domain\Entity\Episode;
|
|
||||||
use Slovocast\Domain\FactoryInterface;
|
|
||||||
|
|
||||||
class EpisodeFactory implements FactoryInterface
|
|
||||||
{
|
|
||||||
public static function fromArray(array $props): Episode
|
|
||||||
{
|
|
||||||
$episode = new Episode(
|
|
||||||
$props['title'],
|
|
||||||
$props['link'],
|
|
||||||
(int) $props['length'],
|
|
||||||
$props['description'],
|
|
||||||
$props['serialNumber'],
|
|
||||||
(bool) $props['explicit'],
|
|
||||||
$props['publishedDate'],
|
|
||||||
$props['episodeType']
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($props['id']) {
|
|
||||||
$episode->setId($props['id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($props['created_at']) {
|
|
||||||
$episode->setCreatedAt($props['createdAt']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($props['updated_id']) {
|
|
||||||
$episode->setUpdatedAt($props['updatedAt']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $episode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function toArray(Episode $episode): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Slovocast\Domain\Factory;
|
|
||||||
|
|
||||||
use Slovocast\Domain\Entity\Episode\File;
|
|
||||||
use Slovocast\Domain\FactoryInterface;
|
|
||||||
|
|
||||||
class FileFactory implements FactoryInterface
|
|
||||||
{
|
|
||||||
public static function fromArray(array $props): File
|
|
||||||
{
|
|
||||||
$file = new File(
|
|
||||||
$props['url'],
|
|
||||||
(int) $props['length'],
|
|
||||||
$props['type']
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($props['id']) {
|
|
||||||
$file->setId($props['id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($props['createAt']) {
|
|
||||||
$file->setCreatedAt($props['createdAt']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($props['updatedAt']) {
|
|
||||||
$file->setUpdatedAt($props['updatedAt']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function toArray(File $file): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user