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\Member; |
17
|
|
|
use Eccube\Entity\OrderPdf; |
18
|
|
|
use Symfony\Bridge\Doctrine\RegistryInterface; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* OrderPdfRepository. |
22
|
|
|
* |
23
|
|
|
* This class was generated by the Doctrine ORM. Add your own custom |
24
|
|
|
* repository methods below. |
25
|
|
|
*/ |
26
|
|
|
class OrderPdfRepository extends AbstractRepository |
27
|
|
|
{ |
28
|
28 |
|
public function __construct(RegistryInterface $registry) |
29
|
|
|
{ |
30
|
28 |
|
parent::__construct($registry, OrderPdf::class); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Save admin history. |
35
|
|
|
* |
36
|
|
|
* @param array $arrData |
37
|
|
|
* |
38
|
|
|
* @return bool |
39
|
|
|
*/ |
40
|
1 |
|
public function save($arrData) |
41
|
|
|
{ |
42
|
|
|
/** |
43
|
|
|
* @var Member |
44
|
|
|
*/ |
45
|
1 |
|
$Member = $arrData['admin']; |
46
|
|
|
|
47
|
|
|
try { |
48
|
1 |
|
$OrderPdf = $this->find($Member); |
49
|
1 |
|
if (!$OrderPdf) { |
50
|
1 |
|
$OrderPdf = new OrderPdf(); |
51
|
|
|
} |
52
|
|
|
|
53
|
1 |
|
$OrderPdf->setMemberId($Member->getId()) |
54
|
1 |
|
->setTitle($arrData['title']) |
55
|
1 |
|
->setMessage1($arrData['message1']) |
56
|
1 |
|
->setMessage2($arrData['message2']) |
57
|
1 |
|
->setMessage3($arrData['message3']) |
58
|
1 |
|
->setNote1($arrData['note1']) |
59
|
1 |
|
->setNote2($arrData['note2']) |
60
|
1 |
|
->setNote3($arrData['note3']) |
61
|
1 |
|
->setVisible(true); |
62
|
1 |
|
$this->getEntityManager()->persist($OrderPdf); |
63
|
1 |
|
$this->getEntityManager()->flush($OrderPdf); |
64
|
|
|
} catch (\Exception $e) { |
65
|
|
|
return false; |
66
|
|
|
} |
67
|
|
|
|
68
|
1 |
|
return true; |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|