StoreConfig.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Store\Model\Data;
  7. /**
  8. * Class StoreConfig
  9. *
  10. * @codeCoverageIgnore
  11. */
  12. class StoreConfig extends \Magento\Framework\Api\AbstractExtensibleObject implements
  13. \Magento\Store\Api\Data\StoreConfigInterface
  14. {
  15. const KEY_ID = 'id';
  16. const KEY_CODE = 'code';
  17. const KEY_WEBSITE_ID = 'website_id';
  18. const KEY_LOCALE = 'locale';
  19. const KEY_BASE_CURRENCY_CODE = 'base_currency_code';
  20. const KEY_DEFAULT_DISPLAY_CURRENCY_CODE = 'default_display_currency_code';
  21. const KEY_TIMEZONE = 'timezone';
  22. const KEY_WEIGHT_UNIT = 'weight_unit';
  23. const KEY_BASE_URL = 'base_url';
  24. const KEY_BASE_LINK_URL = 'base_link_url';
  25. const KEY_BASE_STATIC_URL = 'base_static_url';
  26. const KEY_BASE_MEDIA_URL = 'base_media_url';
  27. const KEY_SECURE_BASE_URL = 'secure_base_url';
  28. const KEY_SECURE_BASE_LINK_URL = 'secure_base_link_url';
  29. const KEY_SECURE_BASE_STATIC_URL = 'secure_base_static_url';
  30. const KEY_SECURE_BASE_MEDIA_URL = 'secure_base_media_url';
  31. /**
  32. * Get store id
  33. *
  34. * @return int
  35. */
  36. public function getId()
  37. {
  38. return $this->_get(self::KEY_ID);
  39. }
  40. /**
  41. * Set store id
  42. *
  43. * @param int $id
  44. * @return $this
  45. */
  46. public function setId($id)
  47. {
  48. return $this->setData(self::KEY_ID, $id);
  49. }
  50. /**
  51. * Get store code
  52. *
  53. * @return string
  54. */
  55. public function getCode()
  56. {
  57. return $this->_get(self::KEY_CODE);
  58. }
  59. /**
  60. * Set store code
  61. *
  62. * @param string $code
  63. * @return $this
  64. */
  65. public function setCode($code)
  66. {
  67. return $this->setData(self::KEY_CODE, $code);
  68. }
  69. /**
  70. * Get website id of the store
  71. *
  72. * @return int
  73. */
  74. public function getWebsiteId()
  75. {
  76. return $this->_get(self::KEY_WEBSITE_ID);
  77. }
  78. /**
  79. * Set website id
  80. *
  81. * @param int $websiteId
  82. * @return $this
  83. */
  84. public function setWebsiteId($websiteId)
  85. {
  86. return $this->setData(self::KEY_WEBSITE_ID, $websiteId);
  87. }
  88. /**
  89. * Get store locale
  90. *
  91. * @return string
  92. */
  93. public function getLocale()
  94. {
  95. return $this->_get(self::KEY_LOCALE);
  96. }
  97. /**
  98. * Set store locale
  99. *
  100. * @param string $locale
  101. * @return $this
  102. */
  103. public function setLocale($locale)
  104. {
  105. return $this->setData(self::KEY_LOCALE, $locale);
  106. }
  107. /**
  108. * Get base currency code
  109. *
  110. * @return string
  111. */
  112. public function getBaseCurrencyCode()
  113. {
  114. return $this->_get(self::KEY_BASE_CURRENCY_CODE);
  115. }
  116. /**
  117. * Set base currency code
  118. *
  119. * @param string $baseCurrencyCode
  120. * @return $this
  121. */
  122. public function setBaseCurrencyCode($baseCurrencyCode)
  123. {
  124. return $this->setData(self::KEY_BASE_CURRENCY_CODE, $baseCurrencyCode);
  125. }
  126. /**
  127. * Get default display currency code
  128. *
  129. * @return string
  130. */
  131. public function getDefaultDisplayCurrencyCode()
  132. {
  133. return $this->_get(self::KEY_DEFAULT_DISPLAY_CURRENCY_CODE);
  134. }
  135. /**
  136. * Set default display currency code
  137. *
  138. * @param string $defaultDisplayCurrencyCode
  139. * @return $this
  140. */
  141. public function setDefaultDisplayCurrencyCode($defaultDisplayCurrencyCode)
  142. {
  143. return $this->setData(self::KEY_DEFAULT_DISPLAY_CURRENCY_CODE, $defaultDisplayCurrencyCode);
  144. }
  145. /**
  146. * Return the unit of weight
  147. *
  148. * @return string
  149. */
  150. public function getWeightUnit()
  151. {
  152. return $this->_get(self::KEY_WEIGHT_UNIT);
  153. }
  154. /**
  155. * Set the unit of weight
  156. *
  157. * @param string $weightUnit
  158. * @return $this
  159. */
  160. public function setWeightUnit($weightUnit)
  161. {
  162. return $this->setData(self::KEY_WEIGHT_UNIT, $weightUnit);
  163. }
  164. /**
  165. * Get base URL for the store
  166. *
  167. * @return string
  168. */
  169. public function getBaseUrl()
  170. {
  171. return $this->_get(self::KEY_BASE_URL);
  172. }
  173. /**
  174. * set base URL
  175. *
  176. * @param string $baseUrl
  177. * @return $this
  178. */
  179. public function setBaseUrl($baseUrl)
  180. {
  181. return $this->setData(self::KEY_BASE_URL, $baseUrl);
  182. }
  183. /**
  184. * Get base link URL for the store
  185. *
  186. * @return string
  187. */
  188. public function getBaseLinkUrl()
  189. {
  190. return $this->_get(self::KEY_BASE_LINK_URL);
  191. }
  192. /**
  193. * Get base link URL for the store
  194. *
  195. * @param string $baseLinkUrl
  196. * @return $this
  197. */
  198. public function setBaseLinkUrl($baseLinkUrl)
  199. {
  200. return $this->setData(self::KEY_BASE_LINK_URL, $baseLinkUrl);
  201. }
  202. /**
  203. * Get timezone of the store
  204. *
  205. * @return string
  206. */
  207. public function getTimezone()
  208. {
  209. return $this->_get(self::KEY_TIMEZONE);
  210. }
  211. /**
  212. * Set timezone of the store
  213. *
  214. * @param string $timezone
  215. * @return $this
  216. */
  217. public function setTimezone($timezone)
  218. {
  219. return $this->setData(self::KEY_TIMEZONE, $timezone);
  220. }
  221. /**
  222. * Get base static URL for the store
  223. *
  224. * @return string
  225. */
  226. public function getBaseStaticUrl()
  227. {
  228. return $this->_get(self::KEY_BASE_STATIC_URL);
  229. }
  230. /**
  231. * Set base static URL for the store
  232. *
  233. * @param string $baseStaticUrl
  234. * @return $this
  235. */
  236. public function setBaseStaticUrl($baseStaticUrl)
  237. {
  238. return $this->setData(self::KEY_BASE_STATIC_URL, $baseStaticUrl);
  239. }
  240. /**
  241. * Get base media URL for the store
  242. *
  243. * @return string
  244. */
  245. public function getBaseMediaUrl()
  246. {
  247. return $this->_get(self::KEY_BASE_MEDIA_URL);
  248. }
  249. /**
  250. * Set base media URL for the store
  251. *
  252. * @param string $baseMediaUrl
  253. * @return $this
  254. */
  255. public function setBaseMediaUrl($baseMediaUrl)
  256. {
  257. return $this->setData(self::KEY_BASE_MEDIA_URL, $baseMediaUrl);
  258. }
  259. /**
  260. * Get secure base URL for the store
  261. *
  262. * @return string
  263. */
  264. public function getSecureBaseUrl()
  265. {
  266. return $this->_get(self::KEY_SECURE_BASE_URL);
  267. }
  268. /**
  269. * set secure base URL
  270. *
  271. * @param string $secureBaseUrl
  272. * @return $this
  273. */
  274. public function setSecureBaseUrl($secureBaseUrl)
  275. {
  276. return $this->setData(self::KEY_SECURE_BASE_URL, $secureBaseUrl);
  277. }
  278. /**
  279. * Get secure base link URL for the store
  280. *
  281. * @return string
  282. */
  283. public function getSecureBaseLinkUrl()
  284. {
  285. return $this->_get(self::KEY_SECURE_BASE_LINK_URL);
  286. }
  287. /**
  288. * Set secure base link URL for the store
  289. *
  290. * @param string $secureBaseLinkUrl
  291. * @return $this
  292. */
  293. public function setSecureBaseLinkUrl($secureBaseLinkUrl)
  294. {
  295. return $this->setData(self::KEY_SECURE_BASE_LINK_URL, $secureBaseLinkUrl);
  296. }
  297. /**
  298. * Get secure base static URL for the store
  299. *
  300. * @return string
  301. */
  302. public function getSecureBaseStaticUrl()
  303. {
  304. return $this->_get(self::KEY_SECURE_BASE_STATIC_URL);
  305. }
  306. /**
  307. * Set secure base static URL for the store
  308. *
  309. * @param string $secureBaseStaticUrl
  310. * @return $this
  311. */
  312. public function setSecureBaseStaticUrl($secureBaseStaticUrl)
  313. {
  314. return $this->setData(self::KEY_SECURE_BASE_STATIC_URL, $secureBaseStaticUrl);
  315. }
  316. /**
  317. * Get secure base media URL for the store
  318. *
  319. * @return string
  320. */
  321. public function getSecureBaseMediaUrl()
  322. {
  323. return $this->_get(self::KEY_SECURE_BASE_MEDIA_URL);
  324. }
  325. /**
  326. * Set secure base media URL for the store
  327. *
  328. * @param string $secureBaseMediaUrl
  329. * @return $this
  330. */
  331. public function setSecureBaseMediaUrl($secureBaseMediaUrl)
  332. {
  333. return $this->setData(self::KEY_SECURE_BASE_MEDIA_URL, $secureBaseMediaUrl);
  334. }
  335. /**
  336. * {@inheritdoc}
  337. *
  338. * @return \Magento\Store\Api\Data\StoreConfigExtensionInterface|null
  339. */
  340. public function getExtensionAttributes()
  341. {
  342. return $this->_getExtensionAttributes();
  343. }
  344. /**
  345. * {@inheritdoc}
  346. *
  347. * @param \Magento\Store\Api\Data\StoreConfigExtensionInterface $extensionAttributes
  348. * @return $this
  349. */
  350. public function setExtensionAttributes(
  351. \Magento\Store\Api\Data\StoreConfigExtensionInterface $extensionAttributes
  352. ) {
  353. return $this->_setExtensionAttributes($extensionAttributes);
  354. }
  355. }