mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -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/InvalidEbookUpdatedDatetimeException.php
Normal file
13
lib/Exceptions/InvalidEbookUpdatedDatetimeException.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?
|
||||
namespace Exceptions;
|
||||
|
||||
use Safe\DateTimeImmutable;
|
||||
|
||||
class InvalidEbookUpdatedDatetimeException extends AppException{
|
||||
protected $message = 'Invalid EbookUpdated datetime.';
|
||||
|
||||
public function __construct(DateTimeImmutable $updatedDatetime){
|
||||
$now = new DateTimeImmutable();
|
||||
$this->message = 'Invalid EbookUpdated datetime. ' . $updatedDatetime->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