Account.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <?php
  2. namespace Dotdigitalgroup\Email\Model\Connector;
  3. /**
  4. * Holds Account information.
  5. *
  6. * @SuppressWarnings(PHPMD.ExcessivePublicCount)
  7. */
  8. class Account
  9. {
  10. /**
  11. * @var string
  12. */
  13. public $apiUsername;
  14. /**
  15. * @var string
  16. */
  17. public $apiPassword;
  18. /**
  19. * @var int|string
  20. */
  21. public $limit;
  22. /**
  23. * @var int|string
  24. */
  25. public $contactBookId;
  26. /**
  27. * @var int|string
  28. */
  29. public $subscriberBookId;
  30. /**
  31. * @var array
  32. */
  33. public $websites = [];
  34. /**
  35. * @var array
  36. */
  37. public $csvHeaders;
  38. /**
  39. * @var string
  40. */
  41. public $customersFilename;
  42. /**
  43. * @var string
  44. */
  45. public $subscribersFilename;
  46. /**
  47. * @var array
  48. */
  49. public $mappingHash;
  50. /**
  51. * @var array
  52. */
  53. public $contacts = [];
  54. /**
  55. * @var array
  56. */
  57. public $orders = [];
  58. /**
  59. * @var array
  60. */
  61. public $orderIds;
  62. /**
  63. * @var array
  64. */
  65. public $ordersForSingleSync = [];
  66. /**
  67. * @var array
  68. */
  69. public $orderIdsForSingleSync;
  70. /**
  71. * Set api password.
  72. *
  73. * @param string $apiPassword
  74. *
  75. * @return $this
  76. */
  77. public function setApiPassword($apiPassword)
  78. {
  79. $this->apiPassword = $apiPassword;
  80. return $this;
  81. }
  82. /**
  83. * Get api password.
  84. *
  85. * @return string
  86. */
  87. public function getApiPassword()
  88. {
  89. return $this->apiPassword;
  90. }
  91. /**
  92. * Set api username.
  93. *
  94. * @param string $apiUsername
  95. *
  96. * @return $this
  97. */
  98. public function setApiUsername($apiUsername)
  99. {
  100. $this->apiUsername = $apiUsername;
  101. return $this;
  102. }
  103. /**
  104. * Get api username.
  105. *
  106. * @return string
  107. */
  108. public function getApiUsername()
  109. {
  110. return $this->apiUsername;
  111. }
  112. /**
  113. * Set contact book id.
  114. *
  115. * @param string $contactBookId
  116. *
  117. * @return null
  118. */
  119. public function setContactBookId($contactBookId)
  120. {
  121. $this->contactBookId[$contactBookId] = $contactBookId;
  122. }
  123. /**
  124. * Get contact book ids.
  125. *
  126. * @return string
  127. */
  128. public function getContactBookIds()
  129. {
  130. return $this->contactBookId;
  131. }
  132. /**
  133. * Set contacts.
  134. *
  135. * @param array $contacts
  136. *
  137. * @return null
  138. */
  139. public function setContacts($contacts)
  140. {
  141. if (!empty($this->contacts)) {
  142. $this->contacts += $contacts;
  143. } else {
  144. $this->contacts[] = $contacts;
  145. }
  146. }
  147. /**
  148. * Get contacts.
  149. *
  150. * @return array
  151. */
  152. public function getContacts()
  153. {
  154. return $this->contacts;
  155. }
  156. /**
  157. * Set customers filename.
  158. *
  159. * @param string $customersFilename
  160. *
  161. * @return null
  162. */
  163. public function setCustomersFilename($customersFilename)
  164. {
  165. $this->customersFilename = $customersFilename;
  166. }
  167. /**
  168. * @return string
  169. */
  170. public function getCustomersFilename()
  171. {
  172. return $this->customersFilename;
  173. }
  174. /**
  175. * @param int $limit
  176. *
  177. * @return string
  178. */
  179. public function setLimit($limit)
  180. {
  181. $this->limit = $limit;
  182. }
  183. /**
  184. * @return string
  185. */
  186. public function getLimit()
  187. {
  188. return $this->limit;
  189. }
  190. /**
  191. * @param array $mappingHash
  192. */
  193. public function setMappingHash($mappingHash)
  194. {
  195. $this->mappingHash = $mappingHash;
  196. }
  197. /**
  198. * @return array
  199. */
  200. public function getMappingHash()
  201. {
  202. return $this->mappingHash;
  203. }
  204. /**
  205. * @param array $orders
  206. *
  207. * @return array
  208. */
  209. public function setOrders($orders)
  210. {
  211. foreach ($orders as $order) {
  212. $this->orders[$order->id] = $order->expose();
  213. }
  214. }
  215. /**
  216. * @return array
  217. */
  218. public function getOrders()
  219. {
  220. return $this->orders;
  221. }
  222. /**
  223. * @param string $subscriberBookId
  224. *
  225. * @return array
  226. */
  227. public function setSubscriberBookId($subscriberBookId)
  228. {
  229. $this->subscriberBookId[$subscriberBookId] = $subscriberBookId;
  230. }
  231. /**
  232. * @return string
  233. */
  234. public function getSubscriberBookIds()
  235. {
  236. return $this->subscriberBookId;
  237. }
  238. /**
  239. * @param string $subscribersFilename
  240. *
  241. * @return string
  242. */
  243. public function setSubscribersFilename($subscribersFilename)
  244. {
  245. $this->subscribersFilename = $subscribersFilename;
  246. }
  247. /**
  248. * @return string
  249. */
  250. public function getSubscribersFilename()
  251. {
  252. return $this->subscribersFilename;
  253. }
  254. /**
  255. * @param array $csvHeaders
  256. *
  257. * @return array
  258. */
  259. public function setCsvHeaders($csvHeaders)
  260. {
  261. $this->csvHeaders = $csvHeaders;
  262. }
  263. /**
  264. * @return array
  265. */
  266. public function getCsvHeaders()
  267. {
  268. return $this->csvHeaders;
  269. }
  270. /**
  271. * @param array $websites
  272. *
  273. * @return array
  274. */
  275. public function setWebsites($websites)
  276. {
  277. $this->websites[] = $websites;
  278. }
  279. /**
  280. * @return array
  281. */
  282. public function getWebsites()
  283. {
  284. return $this->websites;
  285. }
  286. /**
  287. * @param array $orderIds
  288. *
  289. * @return array
  290. */
  291. public function setOrderIds($orderIds)
  292. {
  293. $this->orderIds = $orderIds;
  294. }
  295. /**
  296. * @return array
  297. */
  298. public function getOrderIds()
  299. {
  300. return $this->orderIds;
  301. }
  302. /**
  303. * @param array $orders
  304. *
  305. * @return null
  306. */
  307. public function setOrdersForSingleSync($orders)
  308. {
  309. foreach ($orders as $order) {
  310. $this->ordersForSingleSync[$order->id] = $order->expose();
  311. }
  312. }
  313. /**
  314. * @return array
  315. */
  316. public function getOrdersForSingleSync()
  317. {
  318. return $this->ordersForSingleSync;
  319. }
  320. /**
  321. * @param array $orderIds
  322. *
  323. * @return null
  324. */
  325. public function setOrderIdsForSingleSync($orderIds)
  326. {
  327. $this->orderIdsForSingleSync = $orderIds;
  328. }
  329. /**
  330. * @return array
  331. */
  332. public function getOrderIdsForSingleSync()
  333. {
  334. return $this->orderIdsForSingleSync;
  335. }
  336. }