1 | <?php |
||
14 | class ArticleService extends AbstractService |
||
15 | { |
||
16 | /** |
||
17 | * Get the articles. |
||
18 | * |
||
19 | * @param string $articleNumber Article number to filter on. |
||
20 | * @return Get\ApiResponse |
||
21 | 3 | */ |
|
22 | public function getArticles($articleNumber = null) |
||
31 | |||
32 | /** |
||
33 | * Get one article by article number. |
||
34 | * |
||
35 | * @param string $articleNumber Article number of the article to get. |
||
36 | * @return Article|null |
||
37 | 12 | */ |
|
38 | public function getArticle($articleNumber) |
||
52 | |||
53 | /** |
||
54 | * Get the article checkout URL. |
||
55 | * |
||
56 | * @param Article $article The article. |
||
57 | * @param Customer|null $customer The customer. |
||
58 | * @return string |
||
59 | 9 | */ |
|
60 | public function getArticleCheckoutURL(Article $article, Customer $customer = null) |
||
68 | |||
69 | /** |
||
70 | * Get the article checkout URL with customer query params. |
||
71 | * |
||
72 | * @param Article $article The article. |
||
73 | * @param CustomerQueryParams $params The customer query params |
||
74 | * @return string |
||
75 | */ |
||
76 | 9 | public function getArticleCheckoutUrlWithQueryParams(Article $article, CustomerQueryParams $params) |
|
80 | 3 | ||
81 | /** |
||
82 | * Get the checkout URL for an article. |
||
83 | 6 | * |
|
84 | * @param string $articleNumber Article number of the article to get the checkout URL. |
||
85 | * @param Customer $customer The customer for which the checkout URL should be created. |
||
86 | * @return string |
||
87 | * @throws \OutOfBoundsException If the article is not found. |
||
88 | */ |
||
89 | public function getArticleNumberCheckoutURL($articleNumber, Customer $customer = null) |
||
98 | |||
99 | /** |
||
100 | * Get the checkout URL for an article. |
||
101 | * |
||
102 | * @deprecated Use getArticleNumberCheckoutURL |
||
103 | * |
||
104 | * @param string $articleNumber Article number of the article to get the checkout URL. |
||
105 | * @param Customer $customer The customer for which the checkout URL should be created. |
||
106 | * @return string |
||
107 | 6 | */ |
|
108 | public function getCheckoutURL($articleNumber, Customer $customer = null) |
||
112 | 6 | ||
113 | /** |
||
114 | 6 | * Get the checkout URL of an article for a customer. |
|
115 | * |
||
116 | * @param string $customerHash The customer hash. |
||
117 | * @param string $articleNumber The article number. |
||
118 | * @return string |
||
119 | */ |
||
120 | protected function generateCheckoutURLForCustomer($customerHash, $articleNumber) |
||
129 | |||
130 | /** |
||
131 | * Get the checkout URL to change a product for a subscription. |
||
132 | * |
||
133 | * @param Subscription $subscription The subscription. |
||
134 | * @param Article $article The new article. |
||
135 | * @return string |
||
136 | 3 | */ |
|
137 | public function getSubscriptionProductChangeURL(Subscription $subscription, Article $article) |
||
141 | 3 | ||
142 | /** |
||
143 | 3 | * Get the checkout URL to change a product for a subscription. |
|
144 | * |
||
145 | * @param string $subscriptionId The subscription ID. |
||
146 | * @param string $articleNumber The new article number. |
||
147 | * @return string |
||
148 | */ |
||
149 | protected function generateSubscriptionProductChangeURL($subscriptionId, $articleNumber) |
||
158 | } |
||
159 |