query = $query; } public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { $query->orderBy('id'); return $query; } public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { if($this->section) { $query->filterBySection($this->section); } return $query; } public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface { return $query; } // findGiftVouchersByOrder public function getGiftVouchersByOrder(OrderShopInterface $orderShop): array { $query = $this->createQuery(); $query ->filterByOrderShop($orderShop) ->filterIsGiftVoucherActive(); return $query->find(); } // findOrderProductsInCartsByProduct public function getInCartsByProduct(ProductInterface $product, $query = null): array { $query = $this->createDefaultQuery($query); $query->filterByProduct($product); $query->filterByOrderStatus(OrderStatusModel::$statusAliasAsValid); return $query->find(); } }