make retrievel episode actions without guid more explanatory
This commit is contained in:
parent
9f0c06e919
commit
3a3038711f
|
@ -84,17 +84,30 @@ class EpisodeActionSaver
|
|||
);
|
||||
|
||||
if ($episodeActionEntityToUpdate === null && $episodeActionEntity->getGuid() !== null) {
|
||||
$episodeActionEntityToUpdate = $this->episodeActionRepository->findByEpisodeIdentifier(
|
||||
$episodeActionEntity->getEpisode(),
|
||||
$userId
|
||||
$episodeActionEntityToUpdate = $this->getOldEpisodeActionByEpisodeUrl(
|
||||
$episodeActionEntity->getEpisode(), $userId
|
||||
);
|
||||
}
|
||||
$idEpisodeActionEntityToUpdate = $episodeActionEntityToUpdate->getId();
|
||||
$episodeActionEntity->setId($idEpisodeActionEntityToUpdate);
|
||||
|
||||
$episodeActionEntity->setId($episodeActionEntityToUpdate->getId());
|
||||
|
||||
return $this->episodeActionWriter->update($episodeActionEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $episodeUrl
|
||||
* @param string $userId
|
||||
*
|
||||
* @return EpisodeActionEntity|null
|
||||
*/
|
||||
private function getOldEpisodeActionByEpisodeUrl(string $episodeUrl, string $userId): ?EpisodeActionEntity
|
||||
{
|
||||
return $this->episodeActionRepository->findByEpisodeIdentifier(
|
||||
$episodeUrl,
|
||||
$userId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EpisodeAction $episodeAction
|
||||
* @param string $userId
|
||||
|
|
Loading…
Reference in New Issue