Code Duplication    Length = 11-13 lines in 2 locations

src/Eccube/Repository/ProductRepository.php 1 location

@@ 308-320 (lines=13) @@
305
     * @see CustomerFavoriteProductRepository::getQueryBuilderByCustomer()
306
     * @deprecated since 3.0.0, to be removed in 3.1
307
     */
308
    public function getFavoriteProductQueryBuilderByCustomer($Customer)
309
    {
310
        $qb = $this->createQueryBuilder('p')
311
            ->innerJoin('p.CustomerFavoriteProducts', 'cfp')
312
            ->where('cfp.Customer = :Customer AND p.Status = 1')
313
            ->setParameter('Customer', $Customer);
314
315
        // Order By
316
        // XXX Paginater を使用した場合に PostgreSQL で正しくソートできない
317
        $qb->addOrderBy('cfp.create_date', 'DESC');
318
319
        return $this->queries->customize(QueryKey::PRODUCT_GET_FAVORITE, $qb, ['customer' => $Customer]);
320
    }
321
}
322

src/Eccube/Repository/OrderRepository.php 1 location

@@ 488-498 (lines=11) @@
485
     *
486
     * @return QueryBuilder
487
     */
488
    public function getQueryBuilderByCustomer(\Eccube\Entity\Customer $Customer)
489
    {
490
        $qb = $this->createQueryBuilder('o')
491
            ->where('o.Customer = :Customer')
492
            ->setParameter('Customer', $Customer);
493
494
        // Order By
495
        $qb->addOrderBy('o.id', 'DESC');
496
497
        return $this->queries->customize(QueryKey::ORDER_SEARCH_BY_CUSTOMER, $qb, ['customer' => $Customer]);
498
    }
499
500
    /**
501
     * ステータスごとの受注件数を取得する.