1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* WellCommerce Open-Source E-Commerce Platform |
4
|
|
|
* |
5
|
|
|
* This file is part of the WellCommerce package. |
6
|
|
|
* |
7
|
|
|
* (c) Adam Piotrowski <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, |
10
|
|
|
* please view the LICENSE file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace WellCommerce\Bundle\AppBundle\Entity; |
14
|
|
|
|
15
|
|
|
use Knp\DoctrineBehaviors\Model\Blameable\Blameable; |
16
|
|
|
use Knp\DoctrineBehaviors\Model\Timestampable\Timestampable; |
17
|
|
|
use Knp\DoctrineBehaviors\Model\Translatable\Translatable; |
18
|
|
|
use WellCommerce\Bundle\CoreBundle\Doctrine\Behaviours\Identifiable; |
19
|
|
|
use WellCommerce\Bundle\CoreBundle\Entity\EntityInterface; |
20
|
|
|
use WellCommerce\Bundle\CoreBundle\Entity\MailerConfiguration; |
21
|
|
|
use WellCommerce\Extra\AppBundle\Entity\ShopExtraTrait; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Class Shop |
25
|
|
|
* |
26
|
|
|
* @author Adam Piotrowski <[email protected]> |
27
|
|
|
*/ |
28
|
|
|
class Shop implements EntityInterface |
29
|
|
|
{ |
30
|
|
|
use Identifiable; |
31
|
|
|
use Timestampable; |
32
|
|
|
use Blameable; |
33
|
|
|
use Translatable; |
34
|
|
|
use ShopExtraTrait; |
35
|
|
|
|
36
|
|
|
protected $name = ''; |
37
|
|
|
protected $url = ''; |
38
|
|
|
protected $defaultCountry = ''; |
39
|
|
|
protected $defaultCurrency = ''; |
40
|
|
|
protected $enableClient = true; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var MinimumOrderAmount |
44
|
|
|
*/ |
45
|
|
|
protected $minimumOrderAmount; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var MailerConfiguration |
49
|
|
|
*/ |
50
|
|
|
protected $mailerConfiguration; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var Company |
54
|
|
|
*/ |
55
|
|
|
protected $company; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var ClientGroup |
59
|
|
|
*/ |
60
|
|
|
protected $clientGroup; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var Theme |
64
|
|
|
*/ |
65
|
|
|
protected $theme; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var Media |
69
|
|
|
*/ |
70
|
|
|
protected $logo; |
71
|
|
|
|
72
|
|
|
public function __construct() |
73
|
|
|
{ |
74
|
|
|
$this->mailerConfiguration = new MailerConfiguration(); |
75
|
|
|
$this->minimumOrderAmount = new MinimumOrderAmount(); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function getName(): string |
79
|
|
|
{ |
80
|
|
|
return $this->name; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function setName(string $name) |
84
|
|
|
{ |
85
|
|
|
$this->name = $name; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function getCompany() |
89
|
|
|
{ |
90
|
|
|
return $this->company; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
public function setCompany(Company $company = null) |
94
|
|
|
{ |
95
|
|
|
$this->company = $company; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function getUrl(): string |
99
|
|
|
{ |
100
|
|
|
return $this->url; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
public function setUrl(string $url) |
104
|
|
|
{ |
105
|
|
|
$this->url = $url; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function getDefaultCountry(): string |
109
|
|
|
{ |
110
|
|
|
return $this->defaultCountry; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
public function setDefaultCountry(string $defaultCountry) |
114
|
|
|
{ |
115
|
|
|
$this->defaultCountry = $defaultCountry; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
public function getDefaultCurrency(): string |
119
|
|
|
{ |
120
|
|
|
return $this->defaultCurrency; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
public function setDefaultCurrency(string $defaultCurrency) |
124
|
|
|
{ |
125
|
|
|
$this->defaultCurrency = $defaultCurrency; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function setMailerConfiguration(MailerConfiguration $configuration) |
129
|
|
|
{ |
130
|
|
|
$this->mailerConfiguration = $configuration; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
public function getMailerConfiguration(): MailerConfiguration |
134
|
|
|
{ |
135
|
|
|
return $this->mailerConfiguration; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
public function getClientGroup() |
139
|
|
|
{ |
140
|
|
|
return $this->clientGroup; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
public function setClientGroup(ClientGroup $clientGroup = null) |
144
|
|
|
{ |
145
|
|
|
$this->clientGroup = $clientGroup; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
public function getTheme() |
149
|
|
|
{ |
150
|
|
|
return $this->theme; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
public function setTheme(Theme $theme = null) |
154
|
|
|
{ |
155
|
|
|
$this->theme = $theme; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
public function getMinimumOrderAmount(): MinimumOrderAmount |
159
|
|
|
{ |
160
|
|
|
return $this->minimumOrderAmount; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
public function setMinimumOrderAmount(MinimumOrderAmount $minimumOrderAmount) |
164
|
|
|
{ |
165
|
|
|
$this->minimumOrderAmount = $minimumOrderAmount; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
public function isEnableClient(): bool |
169
|
|
|
{ |
170
|
|
|
return $this->enableClient; |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
public function setEnableClient(bool $enableClient) |
174
|
|
|
{ |
175
|
|
|
$this->enableClient = $enableClient; |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
public function getLogo() |
179
|
|
|
{ |
180
|
|
|
return $this->logo; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
public function setLogo(Media $logo = null) |
184
|
|
|
{ |
185
|
|
|
$this->logo = $logo; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
public function translate($locale = null, $fallbackToDefault = true): ShopTranslation |
189
|
|
|
{ |
190
|
|
|
return $this->doTranslate($locale, $fallbackToDefault); |
191
|
|
|
} |
192
|
|
|
} |
193
|
|
|
|