diff --git a/src/Values/Episode.php b/src/Values/Episode.php index e35595b..012ea82 100644 --- a/src/Values/Episode.php +++ b/src/Values/Episode.php @@ -17,6 +17,16 @@ final public function __construct( ) { } + public static function fromArray(array $data): static + { + return new static( + title: Arr::get($data, 'title'), + guid: EpisodeGuid::fromArray(Arr::get($data, 'guid')), + enclosure: Enclosure::fromArray(Arr::get($data, 'enclosure')), + metadata: EpisodeMetadata::fromArray(Arr::get($data, 'metadata', [])), + ); + } + public static function fromXmlElement(Element $item): static { try { diff --git a/src/Values/EpisodeGuid.php b/src/Values/EpisodeGuid.php index 51d8ea7..df0fecb 100644 --- a/src/Values/EpisodeGuid.php +++ b/src/Values/EpisodeGuid.php @@ -28,7 +28,7 @@ public static function fromXmlElement(Element $element): static public static function fromArray(array $data): static { return new static( - value: Arr::get($data, 'guid'), + value: Arr::get($data, 'value'), isPermaLink: Arr::get($data, 'is_perma_link'), ); }