mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 22:30:30 -04:00
Add poll system for Patrons Circle
This commit is contained in:
parent
3555d53615
commit
2ef5ce6551
44 changed files with 717 additions and 98 deletions
6
lib/Exceptions/InvalidPatronException.php
Normal file
6
lib/Exceptions/InvalidPatronException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPatronException extends SeException{
|
||||
protected $message = 'We couldn’t locate you in the Patrons Circle.';
|
||||
}
|
6
lib/Exceptions/InvalidPollException.php
Normal file
6
lib/Exceptions/InvalidPollException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPollException extends SeException{
|
||||
protected $message = 'We couldn’t locate that poll.';
|
||||
}
|
6
lib/Exceptions/InvalidPollItemException.php
Normal file
6
lib/Exceptions/InvalidPollItemException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidPollItemException extends SeException{
|
||||
protected $message = 'We couldn’t locate that poll item.';
|
||||
}
|
6
lib/Exceptions/InvalidUserException.php
Normal file
6
lib/Exceptions/InvalidUserException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class InvalidUserException extends SeException{
|
||||
protected $message = 'We couldn’t locate you in our system.';
|
||||
}
|
6
lib/Exceptions/PollClosedException.php
Normal file
6
lib/Exceptions/PollClosedException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class PollClosedException extends SeException{
|
||||
protected $message = 'This poll is not open to voting right now.';
|
||||
}
|
6
lib/Exceptions/PollItemRequiredException.php
Normal file
6
lib/Exceptions/PollItemRequiredException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class PollItemRequiredException extends SeException{
|
||||
protected $message = 'You must select an item to vote on.';
|
||||
}
|
|
@ -8,6 +8,12 @@ class ValidationException extends SeException{
|
|||
public $HasExceptions = false;
|
||||
public $IsFatal = false;
|
||||
|
||||
public function __construct(?\Exception $exception = null){
|
||||
if($exception !== null){
|
||||
$this->Add($exception);
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString(): string{
|
||||
$output = '';
|
||||
foreach($this->Exceptions as $exception){
|
||||
|
|
6
lib/Exceptions/VoteExistsException.php
Normal file
6
lib/Exceptions/VoteExistsException.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
class VoteExistsException extends SeException{
|
||||
protected $message = 'You’ve already voted in this poll.';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue