nextcloud-gpodder/lib/Db/EpisodeAction/EpisodeActionWriter.php
Matthias Gutjahr 1d2056e025 Add check for EpisodeAction properties
- also add type hints and phpdocs
- add additional unit tests
- set integer types in EpisodeActionEntity
- correctly call static methods
- improve exception handling in EpisodeActionSaver
- remove unused method EpisodeActionWriter::purge()
2021-11-03 13:51:26 +01:00

34 lines
713 B
PHP

<?php
declare(strict_types=1);
namespace OCA\GPodderSync\Db\EpisodeAction;
use OCP\DB\Exception;
class EpisodeActionWriter {
/**
* @var EpisodeActionMapper
*/
private EpisodeActionMapper $episodeActionMapper;
public function __construct(EpisodeActionMapper $episodeActionMapper) {
$this->episodeActionMapper = $episodeActionMapper;
}
/**
* @throws Exception
*/
public function save(EpisodeActionEntity $episodeActionEntity): EpisodeActionEntity {
return $this->episodeActionMapper->insert($episodeActionEntity);
}
/**
* @throws Exception
*/
public function update(EpisodeActionEntity $episodeActionEntity) {
return $this->episodeActionMapper->update($episodeActionEntity);
}
}