Additional Ebook validation

This commit is contained in:
Mike Colagrosso 2024-04-26 23:52:28 -06:00 committed by Alex Cabal
parent 3ef1af1237
commit 032032b920
22 changed files with 262 additions and 2 deletions

View 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') . '.';
}
}