From e300f2b679dbef40bea468260b38c0f0dc18e055 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Tue, 31 Dec 2024 10:05:46 -0500 Subject: [PATCH] Add an interface for the Channel Aggregate so we can test it easier. --- app/src/Domain/Aggregate/ChannelAggregate.php | 2 +- .../Aggregate/ChannelAggregateInterface.php | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 app/src/Domain/Aggregate/ChannelAggregateInterface.php diff --git a/app/src/Domain/Aggregate/ChannelAggregate.php b/app/src/Domain/Aggregate/ChannelAggregate.php index 77bf1f8..6ae97b8 100644 --- a/app/src/Domain/Aggregate/ChannelAggregate.php +++ b/app/src/Domain/Aggregate/ChannelAggregate.php @@ -5,7 +5,7 @@ namespace Slovocast\Domain\Aggregate; use Slovocast\Domain\Entity\Episode; use Slovocast\Domain\Entity\Channel; -class ChannelAggregate +class ChannelAggregate implements ChannelAggregateInterface { /** * @param Channel $channel diff --git a/app/src/Domain/Aggregate/ChannelAggregateInterface.php b/app/src/Domain/Aggregate/ChannelAggregateInterface.php new file mode 100644 index 0000000..b245e1f --- /dev/null +++ b/app/src/Domain/Aggregate/ChannelAggregateInterface.php @@ -0,0 +1,25 @@ + + */ + public function getEpisodes(): array; + public function hasEpisodes(): bool; + public function addEpisode(Episode $episode): void; + + /** + * @param array $episodes + * @return void; + */ + public function setEpisodes(array $episodes): void; + +}