public function state()
{
if ($this->entry_starts_at === null || $this->entry_starts_at->isFuture()) {
return 'preparing';
}
if ($this->isSubmissionOpen()) {
return 'entry';
}
if ($this->isVotingOpen()) {
return 'voting';
}
if ($this->show_votes) {
return 'results';
}
return 'over';
}