Skip to content

Commit 3aabe13

Browse files
MAGETWO-32631: Define Public API
- for modules Customer, CustomerImportExport, ProductAlert, Sendfriend, Wishlist
1 parent 94e6406 commit 3aabe13

File tree

7 files changed

+46
-1
lines changed

7 files changed

+46
-1
lines changed

app/code/Magento/Customer/Model/Session.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ public function setCustomerId($id)
291291
/**
292292
* Retrieve customer id from current session
293293
*
294+
* @api
294295
* @return int|null
295296
*/
296297
public function getCustomerId()
@@ -356,6 +357,7 @@ public function getCustomerGroupId()
356357
/**
357358
* Checking customer login status
358359
*
360+
* @api
359361
* @return bool
360362
*/
361363
public function isLoggedIn()
@@ -420,6 +422,7 @@ public function setCustomerDataAsLoggedIn($customer)
420422
/**
421423
* Authorization customer by identifier
422424
*
425+
* @api
423426
* @param int $customerId
424427
* @return bool
425428
*/
@@ -437,6 +440,7 @@ public function loginById($customerId)
437440
/**
438441
* Logout customer
439442
*
443+
* @api
440444
* @return $this
441445
*/
442446
public function logout()

app/code/Magento/CustomerImportExport/Model/Export/Address.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ protected function _getEntityCollection()
202202
/**
203203
* Export process
204204
*
205+
* @api
205206
* @return string
206207
*/
207208
public function export()

app/code/Magento/CustomerImportExport/Model/Export/Customer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public function __construct(
119119
/**
120120
* Export process.
121121
*
122+
* @api
122123
* @return string
123124
*/
124125
public function export()

app/code/Magento/ProductAlert/Model/Email.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public function __construct(
149149
/**
150150
* Set model type
151151
*
152+
* @api
152153
* @param string $type
153154
* @return void
154155
*/
@@ -182,6 +183,7 @@ public function setWebsite(\Magento\Store\Model\Website $website)
182183
/**
183184
* Set website id
184185
*
186+
* @api
185187
* @param int $websiteId
186188
* @return $this
187189
*/
@@ -194,6 +196,7 @@ public function setWebsiteId($websiteId)
194196
/**
195197
* Set customer by id
196198
*
199+
* @api
197200
* @param int $customerId
198201
* @return $this
199202
*/
@@ -232,6 +235,7 @@ public function clean()
232235
/**
233236
* Add product (price change) to collection
234237
*
238+
* @api
235239
* @param \Magento\Catalog\Model\Product $product
236240
* @return $this
237241
*/
@@ -244,6 +248,7 @@ public function addPriceProduct(\Magento\Catalog\Model\Product $product)
244248
/**
245249
* Add product (back in stock) to collection
246250
*
251+
* @api
247252
* @param \Magento\Catalog\Model\Product $product
248253
* @return $this
249254
*/
@@ -282,6 +287,7 @@ protected function _getStockBlock()
282287
/**
283288
* Send customer email
284289
*
290+
* @api
285291
* @return bool
286292
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
287293
* @SuppressWarnings(PHPMD.NPathComplexity)

app/code/Magento/Sendfriend/Model/Sendfriend.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ protected function _construct()
161161
}
162162

163163
/**
164+
* @api
164165
* @return $this
165166
* @throws CoreException
166167
*/
@@ -220,6 +221,7 @@ public function send()
220221
/**
221222
* Validate Form data
222223
*
224+
* @api
223225
* @return bool|string[]
224226
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
225227
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -270,6 +272,7 @@ public function validate()
270272
/**
271273
* Set Recipients
272274
*
275+
* @api
273276
* @param array $recipients
274277
* @return $this
275278
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
@@ -314,6 +317,7 @@ public function setRecipients($recipients)
314317
/**
315318
* Retrieve Recipients object
316319
*
320+
* @api
317321
* @return \Magento\Framework\Object
318322
*/
319323
public function getRecipients()
@@ -329,6 +333,7 @@ public function getRecipients()
329333
/**
330334
* Set product instance
331335
*
336+
* @api
332337
* @param \Magento\Catalog\Model\Product $product
333338
* @return $this
334339
*/
@@ -340,6 +345,7 @@ public function setProduct($product)
340345
/**
341346
* Retrieve Product instance
342347
*
348+
* @api
343349
* @throws \Magento\Framework\Exception\LocalizedException
344350
* @return \Magento\Catalog\Model\Product
345351
*/
@@ -355,6 +361,7 @@ public function getProduct()
355361
/**
356362
* Set Sender Information array
357363
*
364+
* @api
358365
* @param array $sender
359366
* @return $this
360367
*/
@@ -370,6 +377,7 @@ public function setSender($sender)
370377
/**
371378
* Retrieve Sender Information Object
372379
*
380+
* @api
373381
* @throws \Magento\Framework\Exception\LocalizedException
374382
* @return \Magento\Framework\Object
375383
*/

app/code/Magento/Wishlist/Model/Item.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ protected function _construct()
176176
/**
177177
* Set quantity. If quantity is less than 0 - set it to 1
178178
*
179+
* @api
179180
* @param int $qty
180181
* @return $this
181182
*/
@@ -308,6 +309,7 @@ public function afterSave()
308309
/**
309310
* Validate wish list item data
310311
*
312+
* @api
311313
* @return bool
312314
* @throws \Magento\Framework\Exception\LocalizedException
313315
*/
@@ -351,6 +353,7 @@ public function beforeSave()
351353
/**
352354
* Load item by product, wishlist and shared stores
353355
*
356+
* @api
354357
* @param int $wishlistId
355358
* @param int $productId
356359
* @param array $sharedStores
@@ -400,6 +403,7 @@ public function getProduct()
400403
* Return true if product was successful added or exception with code
401404
* Return false for disabled or unvisible products
402405
*
406+
* @api
403407
* @param \Magento\Checkout\Model\Cart $cart
404408
* @param bool $delete delete the item after successful add to cart
405409
* @return bool
@@ -471,6 +475,7 @@ public function getProductUrl()
471475
* Returns formatted buy request - object, holding request received from
472476
* product view page with keys and options for configured product
473477
*
478+
* @api
474479
* @return \Magento\Framework\Object
475480
*/
476481
public function getBuyRequest()
@@ -572,6 +577,7 @@ public function isRepresent($product, $buyRequest)
572577
/**
573578
* Check product representation in item
574579
*
580+
* @api
575581
* @param \Magento\Catalog\Model\Product $product
576582
* @return bool
577583
*/
@@ -620,6 +626,7 @@ public function compareOptions($options1, $options2)
620626
/**
621627
* Initialize item options
622628
*
629+
* @api
623630
* @param array $options
624631
* @return $this
625632
*/
@@ -634,6 +641,7 @@ public function setOptions($options)
634641
/**
635642
* Get all item options
636643
*
644+
* @api
637645
* @return Option[]
638646
*/
639647
public function getOptions()
@@ -654,6 +662,7 @@ public function getOptionsByCode()
654662
/**
655663
* Add option to item
656664
*
665+
* @api
657666
* @param Option|\Magento\Framework\Object|array $option
658667
* @return $this
659668
* @throws \Magento\Framework\Exception\LocalizedException
@@ -683,8 +692,9 @@ public function addOption($option)
683692
}
684693

685694
/**
686-
*Remove option from item options
695+
* Remove option from item options
687696
*
697+
* @api
688698
* @param string $code
689699
* @return $this
690700
*/
@@ -700,6 +710,7 @@ public function removeOption($code)
700710
/**
701711
* Get item option by code
702712
*
713+
* @api
703714
* @param string $code
704715
* @return Option|null
705716
*/
@@ -763,6 +774,7 @@ public function getFileDownloadParams()
763774
* If we need to load only some of options, then option code or array of option codes
764775
* can be provided in $optionsFilter.
765776
*
777+
* @api
766778
* @param int $id
767779
* @param null|string|array $optionsFilter
768780
*

app/code/Magento/Wishlist/Model/Wishlist.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public function __construct(
172172
/**
173173
* Load wishlist by customer id
174174
*
175+
* @api
175176
* @param int $customerId
176177
* @param bool $create Create wishlist if don't exists
177178
* @return $this
@@ -196,6 +197,7 @@ public function loadByCustomerId($customerId, $create = false)
196197
/**
197198
* Retrieve wishlist name
198199
*
200+
* @api
199201
* @return string
200202
*/
201203
public function getName()
@@ -210,6 +212,7 @@ public function getName()
210212
/**
211213
* Set random sharing code
212214
*
215+
* @api
213216
* @return $this
214217
*/
215218
public function generateSharingCode()
@@ -221,6 +224,7 @@ public function generateSharingCode()
221224
/**
222225
* Load by sharing code
223226
*
227+
* @api
224228
* @param string $code
225229
* @return $this
226230
*/
@@ -335,6 +339,7 @@ public function getItemCollection()
335339
/**
336340
* Retrieve wishlist item collection
337341
*
342+
* @api
338343
* @param int $itemId
339344
* @return false|Item
340345
*/
@@ -349,6 +354,7 @@ public function getItem($itemId)
349354
/**
350355
* Adding item to wishlist
351356
*
357+
* @api
352358
* @param Item $item
353359
* @return $this
354360
*/
@@ -366,6 +372,7 @@ public function addItem(Item $item)
366372
* Adds new product to wishlist.
367373
* Returns new item or string on error.
368374
*
375+
* @api
369376
* @param int|\Magento\Catalog\Model\Product $product
370377
* @param \Magento\Framework\Object|array|string|null $buyRequest
371378
* @param bool $forciblySetQty
@@ -455,6 +462,7 @@ public function addNewItem($product, $buyRequest = null, $forciblySetQty = false
455462
/**
456463
* Set customer id
457464
*
465+
* @api
458466
* @param int $customerId
459467
* @return $this
460468
*/
@@ -466,6 +474,7 @@ public function setCustomerId($customerId)
466474
/**
467475
* Retrieve customer id
468476
*
477+
* @api
469478
* @return int
470479
*/
471480
public function getCustomerId()
@@ -524,6 +533,7 @@ public function setSharedStoreIds($storeIds)
524533
/**
525534
* Retrieve wishlist store object
526535
*
536+
* @api
527537
* @return \Magento\Store\Model\Store
528538
*/
529539
public function getStore()
@@ -537,6 +547,7 @@ public function getStore()
537547
/**
538548
* Set wishlist store
539549
*
550+
* @api
540551
* @param \Magento\Store\Model\Store $store
541552
* @return $this
542553
*/
@@ -549,6 +560,7 @@ public function setStore($store)
549560
/**
550561
* Retrieve wishlist items count
551562
*
563+
* @api
552564
* @return int
553565
*/
554566
public function getItemsCount()
@@ -596,6 +608,7 @@ public function isOwner($customerId)
596608
*
597609
* For more options see \Magento\Catalog\Helper\Product->addParamsToBuyRequest()
598610
*
611+
* @api
599612
* @param int|Item $itemId
600613
* @param \Magento\Framework\Object $buyRequest
601614
* @param null|array|\Magento\Framework\Object $params

0 commit comments

Comments
 (0)