* @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\Presenter\Order; use Exception; use Hook; use Order; use PrestaShop\PrestaShop\Adapter\Presenter\PresenterInterface; class OrderPresenter implements PresenterInterface { /** * @param Order $order * * @return OrderLazyArray * * @throws Exception */ public function present($order) { if (!($order instanceof Order)) { throw new Exception('OrderPresenter can only present instance of Order'); } $orderLazyArray = new OrderLazyArray($order); Hook::exec('actionPresentOrder', ['presentedOrder' => &$orderLazyArray] ); return $orderLazyArray; } }