mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 23:30:35 -04:00
Additional Ebook validation
This commit is contained in:
parent
3ef1af1237
commit
032032b920
22 changed files with 262 additions and 2 deletions
13
lib/Exceptions/InvalidEbookCreatedDatetimeException.php
Normal file
13
lib/Exceptions/InvalidEbookCreatedDatetimeException.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
class InvalidEbookCreatedDatetimeException extends AppException{
|
||||
protected $message = 'Invalid EbookCreated datetime.';
|
||||
|
||||
public function __construct(DateTimeImmutable $createdDatetime){
|
||||
$now = new DateTimeImmutable();
|
||||
$this->message = 'Invalid EbookCreated datetime. ' . $createdDatetime->format('Y-m-d') . ' is not between ' . EBOOK_EARLIEST_CREATION_DATE->format('Y-m-d') . ' and ' . $now->format('Y-m-d') . '.';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue