* @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; class OrderMessagesForViewing { /** @var OrderMessageForViewing[] */ private $messages = []; /** * @var int */ private $total; /** * @param OrderMessageForViewing[] $messages * @param int $total */ public function __construct(array $messages, int $total) { foreach ($messages as $message) { $this->add($message); } $this->total = $total; } /** * @return OrderMessageForViewing[] */ public function getMessages(): array { return $this->messages; } /** * @return int */ public function getTotal(): int { return $this->total; } /** * @param OrderMessageForViewing $message */ private function add(OrderMessageForViewing $message): void { $this->messages[] = $message; } }