Added canVote() to poll
This commit is contained in:
parent
bb14f7e97a
commit
c2434cfedc
@ -125,8 +125,12 @@ class Poll
|
|||||||
public function canVote()
|
public function canVote()
|
||||||
{
|
{
|
||||||
$is_authenticated = $this->api->isAuthenticated(false, true);
|
$is_authenticated = $this->api->isAuthenticated(false, true);
|
||||||
$is_closed = $this->closed_at <= new \DateTime();
|
return $is_authenticated && !$this->isClosed();
|
||||||
return $is_authenticated && !$is_closed;
|
}
|
||||||
|
|
||||||
|
public function isClosed()
|
||||||
|
{
|
||||||
|
return $this->closed_at <= new \DateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString(): string
|
public function __toString(): string
|
||||||
|
Loading…
Reference in New Issue
Block a user