Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. class CartPreviewComponent {
  4.  
  5. public function __construct(CartModel $cartModel, $userId){
  6. $this->cartModel = $cartModel;
  7. $this->userId = $userId;
  8. }
  9.  
  10. public function render(){
  11. return view('CartPreviewComponentTemplate', ['items' => $this->getItems()]);
  12. }
  13.  
  14. public function getItems(){
  15. return $this->cartModel->getUserCart($this->userId);
  16. }
  17.  
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement