* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Adapter\OrderMessage; use OrderMessage; /** * Gets order messages. */ class OrderMessageProvider { /** * @var int */ private $contextLanguageId; /** * @param int $contextLanguageId */ public function __construct(int $contextLanguageId) { $this->contextLanguageId = $contextLanguageId; } /** * @param int|null $langId * * @return array */ public function getMessages(int $langId = null): array { $result = OrderMessage::getOrderMessages($langId ?? $this->contextLanguageId); return is_array($result) ? $result : []; } }