Commit b3841d10 authored by Stefan Busemann's avatar Stefan Busemann
Browse files

[TASK] Refactor method chain call to retrieve timestamp

parent b006310f
......@@ -83,9 +83,7 @@ class FeElectionController extends ActionController
AbstractMessage::ERROR
);
$this->redirect(FeDashboardController::ACTION_INDEX, FeDashboardController::CONTROLLER_NAME);
} elseif ($electionInvitation->getElectionCircular()->getElection()->getEndDate()->getTimestamp()
< time()
) {
} elseif ($electionInvitation->getElectionEndDateAsTimestamp() < time()) {
$this->addFlashMessage(
LocalizationUtility::translate('controller.fe.election.vote.election_finished', 'election'),
LocalizationUtility::translate('controller.fe.election.vote.request_failed', 'election'),
......
......@@ -123,4 +123,12 @@ class ElectionInvitation extends AbstractEntity
{
$this->voted = $voted;
}
/**
* @return int
*/
public function getElectionEndDateAsTimestamp()
{
return $this->getElectionCircular()->getElection()->getEndDate()->getTimestamp();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment