* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Core\Domain\Order\QueryResult; use DateTimeImmutable; /** * Used in order page view to display date in wanted format. */ class OrderMessageDateForViewing { /** * @var DateTimeImmutable */ private $date; /** * @var string */ private $dateFormat; public function __construct(DateTimeImmutable $date, string $dateFormat) { $this->date = $date; $this->dateFormat = $dateFormat; } /** * @return DateTimeImmutable */ public function getDate(): DateTimeImmutable { return $this->date; } /** * @return string */ public function getFormat(): string { return $this->date->format($this->dateFormat); } }