Code Duplication    Length = 11-13 lines in 2 locations

src/Eccube/Repository/OrderRepository.php 1 location

@@ 442-452 (lines=11) @@
439
     * @param  \Eccube\Entity\Customer $Customer
440
     * @return QueryBuilder
441
     */
442
    public function getQueryBuilderByCustomer(\Eccube\Entity\Customer $Customer)
443
    {
444
        $qb = $this->createQueryBuilder('o')
445
            ->where('o.Customer = :Customer')
446
            ->setParameter('Customer', $Customer);
447
448
        // Order By
449
        $qb->addOrderBy('o.id', 'DESC');
450
451
        return $this->app['eccube.queries']->customize(QueryKey::ORDER_SEARCH_BY_CUSTOMER, $qb, ['customer' => $Customer]);
452
    }
453
454
    /**
455
     * 新規受付一覧の取得

src/Eccube/Repository/ProductRepository.php 1 location

@@ 269-281 (lines=13) @@
266
     * @see CustomerFavoriteProductRepository::getQueryBuilderByCustomer()
267
     * @deprecated since 3.0.0, to be removed in 3.1
268
     */
269
    public function getFavoriteProductQueryBuilderByCustomer($Customer)
270
    {
271
        $qb = $this->createQueryBuilder('p')
272
            ->innerJoin('p.CustomerFavoriteProducts', 'cfp')
273
            ->where('cfp.Customer = :Customer AND p.Status = 1')
274
            ->setParameter('Customer', $Customer);
275
276
        // Order By
277
        // XXX Paginater を使用した場合に PostgreSQL で正しくソートできない
278
        $qb->addOrderBy('cfp.create_date', 'DESC');
279
280
        return $this->app['eccube.queries']->customize(QueryKey::PRODUCT_GET_FAVORITE, $qb, ['customer' => $Customer]);
281
    }
282
}
283