web/lib/Exceptions/InvalidEbookUpdatedDatetimeException.php
2024-11-04 13:16:56 -06:00

17 lines
543 B
PHP

<?
namespace Exceptions;
use Safe\DateTimeImmutable;
class InvalidEbookUpdatedDatetimeException extends AppException{
/** @var string $message */
protected $message = 'Invalid EbookUpdated datetime.';
/**
* @throws \Exception
*/
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') . '.';
}
}