Add an interface for the Channel Aggregate so we can test it easier.
This commit is contained in:
parent
89b2fc0689
commit
e300f2b679
@ -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
|
||||
|
25
app/src/Domain/Aggregate/ChannelAggregateInterface.php
Normal file
25
app/src/Domain/Aggregate/ChannelAggregateInterface.php
Normal 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;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user