ItemCreation.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\Order\Invoice;
  7. use Magento\Sales\Api\Data\InvoiceItemCreationInterface;
  8. /**
  9. * Class LineItem
  10. */
  11. class ItemCreation implements InvoiceItemCreationInterface
  12. {
  13. /**
  14. * @var int
  15. */
  16. private $orderItemId;
  17. /**
  18. * @var float
  19. */
  20. private $qty;
  21. /**
  22. * @var \Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface
  23. */
  24. private $extensionAttributes;
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function getOrderItemId()
  29. {
  30. return $this->orderItemId;
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function setOrderItemId($orderItemId)
  36. {
  37. $this->orderItemId = $orderItemId;
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function getQty()
  43. {
  44. return $this->qty;
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function setQty($qty)
  50. {
  51. $this->qty = $qty;
  52. }
  53. /**
  54. * Retrieve existing extension attributes object or create a new one.
  55. *
  56. * @return \Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface|null
  57. */
  58. public function getExtensionAttributes()
  59. {
  60. return $this->extensionAttributes;
  61. }
  62. /**
  63. * Set an extension attributes object.
  64. *
  65. * @param \Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface $extensionAttributes
  66. * @return $this
  67. */
  68. public function setExtensionAttributes(
  69. \Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface $extensionAttributes
  70. ) {
  71. $this->extensionAttributes = $extensionAttributes;
  72. return $this;
  73. }
  74. }