Refactor
This commit is contained in:
parent
6fe88456ca
commit
aa08f702b2
4 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ final class Episode extends Node implements NodeInterface {
|
|||
public const NODE_TYPE = 'podcast_episode';
|
||||
|
||||
public function getGuests(): Guests {
|
||||
return Guests::new($this->get('field_podcast_guests')->referencedEntities());
|
||||
return Guests::fromGuests($this->get('field_podcast_guests')->referencedEntities());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ final class Guests implements \Countable, \IteratorAggregate, \Stringable {
|
|||
/**
|
||||
* @param Guest[] $guests
|
||||
*/
|
||||
public static function new(array $guests): self {
|
||||
public static function fromGuests(array $guests): self {
|
||||
return new self($guests);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ readonly final class Events implements \IteratorAggregate {
|
|||
/**
|
||||
* @param Event[] $events
|
||||
*/
|
||||
public static function new(array $events): self {
|
||||
public static function fromEvents(array $events): self {
|
||||
return new self($events);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ final class Presentation extends Node implements NodeInterface {
|
|||
public const NODE_TYPE = 'presentation';
|
||||
|
||||
public function getPastEvents(): Events {
|
||||
$events = Events::new($this->get('field_events')->referencedEntities());
|
||||
$events = Events::fromEvents($this->get('field_events')->referencedEntities());
|
||||
|
||||
$today = strtotime('today');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue