public function currentPhaseEndDate() { switch ($this->state()) { case 'entry': return $this->entry_ends_at; case 'voting': return $this->voting_ends_at; } }