Add an interface for the Channel Aggregate so we can test it easier.

This commit is contained in:
Dave Smith-Hayes 2024-12-31 10:05:46 -05:00
parent 89b2fc0689
commit e300f2b679
2 changed files with 26 additions and 1 deletions

View File

@ -5,7 +5,7 @@ namespace Slovocast\Domain\Aggregate;
use Slovocast\Domain\Entity\Episode; use Slovocast\Domain\Entity\Episode;
use Slovocast\Domain\Entity\Channel; use Slovocast\Domain\Entity\Channel;
class ChannelAggregate class ChannelAggregate implements ChannelAggregateInterface
{ {
/** /**
* @param Channel $channel * @param Channel $channel

View File

@ -0,0 +1,25 @@
<?php
namespace Slovocast\Domain\Aggregate;
use Slovocast\Domain\Entity\Channel;
use Slovocast\Domain\Entity\Episode;
interface ChannelAggregateInterface
{
public function getChannel(): Channel;
/**
* @return array<Episode>
*/
public function getEpisodes(): array;
public function hasEpisodes(): bool;
public function addEpisode(Episode $episode): void;
/**
* @param array<Episode> $episodes
* @return void;
*/
public function setEpisodes(array $episodes): void;
}