mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 18:42:00 -04:00
Type tweaks for exceptions and some validation
This commit is contained in:
parent
5b3f8f7b77
commit
7eaa400ae3
13 changed files with 49 additions and 37 deletions
|
@ -7,7 +7,7 @@ use Safe\DateTimeImmutable;
|
|||
* @property string $Url
|
||||
*/
|
||||
class PollVote extends Accessor{
|
||||
public int $UserId;
|
||||
public ?int $UserId = null;
|
||||
public DateTimeImmutable $Created;
|
||||
public ?int $PollItemId = null;
|
||||
protected ?User $_User = null;
|
||||
|
@ -33,7 +33,7 @@ class PollVote extends Accessor{
|
|||
// *******
|
||||
|
||||
protected function Validate(): void{
|
||||
$error = new Exceptions\ValidationException();
|
||||
$error = new Exceptions\InvalidPollVoteException();
|
||||
|
||||
if($this->User === null){
|
||||
$error->Add(new Exceptions\UserNotFoundException());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue