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) {
|
if ($episodeActionEntityToUpdate === null && $episodeActionEntity->getGuid() !== null) {
|
||||||
$episodeActionEntityToUpdate = $this->episodeActionRepository->findByEpisodeIdentifier(
|
$episodeActionEntityToUpdate = $this->getOldEpisodeActionByEpisodeUrl(
|
||||||
$episodeActionEntity->getEpisode(),
|
$episodeActionEntity->getEpisode(), $userId
|
||||||
$userId
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$idEpisodeActionEntityToUpdate = $episodeActionEntityToUpdate->getId();
|
|
||||||
$episodeActionEntity->setId($idEpisodeActionEntityToUpdate);
|
$episodeActionEntity->setId($episodeActionEntityToUpdate->getId());
|
||||||
|
|
||||||
return $this->episodeActionWriter->update($episodeActionEntity);
|
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 EpisodeAction $episodeAction
|
||||||
* @param string $userId
|
* @param string $userId
|
||||||
|
Loading…
Reference in New Issue
Block a user