_createDebugLog('OrderReadService::getOrderById >> Fetch order with ID = ' . $orderId->asInt()); return parent::getOrderById($orderId); } /** * Overloaded "getOrderItemById" method. * * This method will log the use of "getOrderItemById" method in the debug logs of the shop. * * @param IdType $orderItemId * * @return OrderItemInterface */ public function getOrderItemById(IdType $orderItemId) { $this->_createDebugLog('OrderReadSevice::getOrderItemById >> Fetch order item with ID = ' . $orderItemId->asInt()); return parent::getOrderItemById($orderItemId); } /** * Returns an OrderListItemCollection depending on the provided arguments. * * @param \Pager|null $pager (Optional) Pager object with pagination information * @param array $sorters (Optional) array of Sorter objects with data sorting information * * @return OrderListItemCollection Order list item collection. */ public function getOrderList(\Pager $pager = null, array $sorters = []) { $index = $pager ? $pager->offset() : 'null'; $count = $pager ? $pager->perPage() : 'null'; $sortOrder = count($sorters) ? implode(',',$sorters) : 'null'; $this->_createDebugLog('OrderReadService::getOrderList >> Fetch order list with start index ' . $index . ' and max count ' . $count . ' ordered by ' . $sortOrder); return parent::getOrderList($pager, $sorters); } /** * Create new debug log entry. * * @param string $message */ protected function _createDebugLog($message) { $logControl = LogControl::get_instance(); $logControl->notice($message); } }