2021-06-27 11:19:26 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Core\EpisodeAction;
|
|
|
|
|
2021-08-23 00:45:38 +00:00
|
|
|
class EpisodeActionReader
|
|
|
|
{
|
2021-10-04 15:59:05 +00:00
|
|
|
/**
|
|
|
|
* @param $episodeActionsArray[]
|
|
|
|
* @return EpisodeAction[]
|
|
|
|
*/
|
|
|
|
public function fromArray(array $episodeActionsArray): array
|
|
|
|
{
|
|
|
|
$episodeActions = [];
|
|
|
|
|
|
|
|
foreach($episodeActionsArray as $episodeAction) {
|
|
|
|
$episodeActions[] = new EpisodeAction(
|
|
|
|
$episodeAction["podcast"],
|
|
|
|
$episodeAction["episode"],
|
|
|
|
$episodeAction["action"],
|
|
|
|
$episodeAction["timestamp"],
|
|
|
|
$episodeAction["started"],
|
|
|
|
$episodeAction["position"],
|
|
|
|
$episodeAction["total"],
|
|
|
|
$episodeAction["guid"] ?? null,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $episodeActions;
|
|
|
|
}
|
2021-06-27 11:19:26 +00:00
|
|
|
}
|