Guest User

Untitled

a guest
Oct 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. abstract class AbstractItem implements ItemInterface
  2. {
  3. /**
  4. * @var Item
  5. */
  6. protected $item;
  7.  
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function getItemData(Item $item)
  12. {
  13. $this->item = $item;
  14. return array_merge(
  15. ['product_type' => $item->getProductType()],
  16. $this->doGetItemData()
  17. );
  18. }
  19.  
  20. /**
  21. * Get item data. Template method
  22. *
  23. * @return array
  24. */
  25. abstract protected function doGetItemData();
  26. }
  27.  
  28. 'product_sku' => $this->item->getProduct()->getSku()
  29.  
  30. 'product_sku' => $this->item->getProduct()->getId()
Add Comment
Please, Sign In to add comment