You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ygdc/site/models/season.php

17 lines
418 B

2 months ago
<?php
class SeasonPage extends Page {
public function getAllGames() {
$children = new Pages();
foreach ($this->children() as $key => $value) {
$children->add($value->children());
}
return $children;
}
public function getRunningTournaments() {
return $this->children()->filter(
fn ($child) => $child->date()->isEmpty() or $child->date()->toDate()+(60*60*24) > time()
);
}
}