Completed
Pull Request — 4.0 (#3658)
by Kentaro
06:26
created

CustomerAddressRepository::findOrCreateByCustomerAndId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
ccs 12
cts 12
cp 1
crap 2
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Repository;
15
16
use Eccube\Entity\CustomerAddress;
17
use Symfony\Bridge\Doctrine\RegistryInterface;
18
19
/**
20
 * CustomerAddressRepository
21
 *
22
 * This class was generated by the Doctrine ORM. Add your own custom
23
 * repository methods below.
24
 */
25
class CustomerAddressRepository extends AbstractRepository
26
{
27
    /**
28
     * CustomerAddressRepository constructor.
29
     *
30
     * @param RegistryInterface $registry
31
     */
32 102
    public function __construct(RegistryInterface $registry)
33
    {
34 102
        parent::__construct($registry, CustomerAddress::class);
35
    }
36
37
    /**
38
     * お届け先を削除します.
39
     *
40
     * @param \Eccube\Entity\CustomerAddress $CustomerAddress
41
     */
42
    public function delete($CustomerAddress)
43
    {
44
        $em = $this->getEntityManager();
45
        $em->remove($CustomerAddress);
46
        $em->flush($CustomerAddress);
47
    }
48
}
49